Replies: 1 comment 1 reply
-
There isn't a way to do that generically in Luxon right now. We have the code for it, but it's not exposed in a useful way. The way Luxon works is that those options are sent directly to Intl.DateTimeFormat, so we don't actually parse them into a format string as any part of the formatting process. However, because Luxon supports "macro" tokens in the parser (e.g. you can use
The code for 1 & 2 is here: https://github.com/moment/luxon/blob/master/src/impl/tokenParser.js#L383 So this is a feature request Edit: looks like I have an in-progress PR for exposing this: https://github.com/moment/luxon/pull/840/files |
Beta Was this translation helpful? Give feedback.
-
Given I have a custom Intl date format, how can I parse the formatted string as a date?
It seems I'd need to do something similar to the following:
...but I have no idea if I can map the Intl dateTimeOptions to a string with tokens?
Is there a way to achieve what I have in mind?
Beta Was this translation helpful? Give feedback.
All reactions