Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid: Unable to parse (some non-english locales) #22

Open
alexamoralessmyth opened this issue Sep 21, 2022 · 0 comments
Open

Invalid: Unable to parse (some non-english locales) #22

alexamoralessmyth opened this issue Sep 21, 2022 · 0 comments

Comments

@alexamoralessmyth
Copy link

Hello -

I am attempting to implement the 'any-date-parser' in my typescript project. It seems that some locales are causing errors in the .fromString function. Below is an example of my implementation:

node v18.7
typescript v4.7.3

const parser = require('any-date-parser');
const value = new Date(Date.UTC(1955, 10, 5));
const formattedDate = new Intl.DateTimeFormat(new Intl.DateTimeFormat('ja-JP', { dateStyle: 'full'},).format(value);
return parser.fromString(formattedDate, 'ja-JP`);

error:

 {"invalid": "Unable to parse 1955年11月5日土曜日"}

Please let me know if further information is needed. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant