Replies: 2 comments 1 reply
-
So it would seem to be the the "G" for the Era, but it doesn't seem to work for the Japanese calendar. Given: const calendarType = 'japanese';
console.log(DateTime.now().reconfigure({ outputCalendar: calendarType }).toFormat('\'XX\' dd MMMM yyyy G'));
console.log(DateTime.now().reconfigure({ outputCalendar: calendarType }).toLocaleString(DateTime.DATE_FULL)); I get:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
On Chrome on my Mac, your first log line gives me:
What browser (or other environment) are you using? This is how Luxon figures out the era name: new Intl.DateTimeFormat("en-u-ca-japanese", { era: "short" }).formatToParts().find(p => p.type == "era") Which for me returns
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For a project I am trying to display a given date in a localised calendar, but when using the Chinese calendar I am not getting the year name, so I'd be curious to know how to go about getting it?
The following code is providing 'null' for the year, possibly because the years are named and not numbered:
Can anyone suggest the correct tokens for this?
This is a screenshot (from an older project) showing how I'm expecting the date to display:
Beta Was this translation helpful? Give feedback.
All reactions