admin管理员组

文章数量:1126335

We are looking to display different calendars (Persian, Buddhist, Japanese), along with their list of month names, the number of days in a month, day names and where the start of the year is relative to the Gregorian calendar.

I had done something equivalent in Java many years ago, using ICU4J, but I am not sure how to go about this in Javascript?

We looked at the Intl.Locale.getCalendars(), but it is not clear how we could leverage this API for what we want to do.

We generally use luxon for our date handling, but in this case it only seems suitable for outputting the formatted date for the given calendar. For example:

DateTime.now().reconfigure({ outputCalendar: "persian" }).toLocaleString() 

Does anyone have any suggestions on how to achieve what we are wanting to do?

Edit: Currently looking to see if the package world-calendars could do the job.

本文标签: javascriptGetting months in a localised calendarusing NodejsStack Overflow