How to format a CalendarDate #5811
-
Hi there, not sure if I'm just failing to see it in the docs. But just want to format a CalendarDate in a locale specific way ... and only way I can see to do that is converting it to a JS date and then using the formatter. Is there a simpler way? since we don't care about the time component at all, converting to a JS date object seems wrong. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
You are handling it how we would expect. |
Beta Was this translation helpful? Give feedback.
You are handling it how we would expect.
The formatter can omit the time and timezone, however, a time component is necessary in the construction because you may be rendering the same date object in multiple timezones which may affect the actual date in that timezone or even in another calendar system.
Whether you specify a time with a Date object or not, it always has one https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#date_components_and_time_zones