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
It seems the problem lays in format()'s pattern checking. If you add a space in between as so:
format(newDate(2024,3,1),'dd do',{locale: enUS})
it should all work fine. This will however create an output of 01 1st. If you want to keep it in one word just use the .replace() function to remove the space in between:
Thanks for your response.
This was part of a test case. I do not expect it to be used in real life.
The test should make sure the formatting is compatible with icu4j (java lib), icu4j actually formats this pattern as I expect.
I worked around it by sneaking in a zero width space.
I still think that ‘dddo’ is a valid pattern, albeit unusual. There should be a check if the unescaped ‘o’ is part of an ordinal expression.
Op 15 apr. 2024, om 15:04 heeft Miguel Angelo Bautista ***@***.******@***.***>> het volgende geschreven:
U ontvangt niet vaak e-mail van ***@***.******@***.***>. Meer informatie over waarom dit belangrijk is<https://aka.ms/LearnAboutSenderIdentification>
It seems the problem lays in format()'s pattern checking. If you add a space in between as so:
format(new Date(2024, 3, 1), 'dd do', {locale: enUS})
it should all work fine. This will however create an output of 01 1st. If you want to keep it in one word just use the .replace() function to remove the space in between:
format(new Date(2024, 3, 1), 'dd do', {locale: enUS}).replace(" ", "")
—
Reply to this email directly, view it on GitHub<#3765 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A67JTXATEP2V4DUN4QKB6ELY5PF6PAVCNFSM6AAAAABGD4TN2GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJWHAYDMMZQG4>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
There is an issue with the format function
The problem
💻 Code demonstrating the problem
🙁 Actual behavior
RangeError: Format string contains an unescaped latin alphabet character
o
🙂 Expected behavior
Output:
011st
Debug information
The text was updated successfully, but these errors were encountered: