TextStyle in js-joda is undefined

141 Views Asked by At

I imported the classes this way:

const { LocalDate, TextStyle } = require('js-joda');
console.log(TextStyle);

Output:

undefined

I would like to use it as follows:

const dateTime = LocalDate.now()
dateTime.dayOfWeek().getDisplayName(TextStyle.NARROW_STANDALONE);

The LocalDate class works as supposed to. Why TextStyle is undefined ?

1

There are 1 best solutions below

0
On

i don't know if this question is still open/valid since it has been asked a while ago, but with version >=1.6.0, the TextStyle class should also be exported and the above code should work

Regards, Pattrick