You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently using macro tokens for date formats, and I need to expand them for placeholders. However, I have encountered two issues:
(i) The expandMacroTokens functions are not exported, which makes it challenging to use them for custom formatting.
(ii) Not all Luxon formats have corresponding macro tokens (e.g., DATE_MED_WITH_WEEKDAY).
It would be extremely helpful if macro tokens could be added for every format, and if the expandMacroTokens functions could be exported for easier customization.
Thank you for considering this feature request.
The text was updated successfully, but these errors were encountered:
Thank You That Helped, but i also have a locale which might be changing the format so can i pass the locale with the macrotoken format and get the particular format.
Is there a way i can get the format if i pass the JavaScript Date Object and the locale. I need format not the formatted value.
Can we get a macro option for DATE_MED_WITH_WEEKDAY which can change with the locale provided like for other tokens.
Both parseFormatForOpts and expandFormat accept a 2nd parameter "localeOpts", which lets you configure the locale. Specifically this accepts an object with keys locale (like "en-US"), numberingSystem, outputCalendar and weekSettings.
I'm not sure what you want to do here. How do you get a format from a Date object? A Date object is basically just a wrapper around a timestamp. What kind of format do you want to get?
We can't add macro tokens for every conceivable format, at some point we'll run out of letters in the alphabet (many tokens already make no sense in terms of abbreviations). parseFormatForOpts should solve this for you by letting you expand DATE_MED_WITH_WEEKDAY manually.
I am currently using macro tokens for date formats, and I need to expand them for placeholders. However, I have encountered two issues:
(i) The expandMacroTokens functions are not exported, which makes it challenging to use them for custom formatting.
(ii) Not all Luxon formats have corresponding macro tokens (e.g., DATE_MED_WITH_WEEKDAY).
It would be extremely helpful if macro tokens could be added for every format, and if the expandMacroTokens functions could be exported for easier customization.
Thank you for considering this feature request.
The text was updated successfully, but these errors were encountered: