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

Three-letter month format #246

Open
vahida1157 opened this issue Mar 26, 2023 · 3 comments
Open

Three-letter month format #246

vahida1157 opened this issue Mar 26, 2023 · 3 comments

Comments

@vahida1157
Copy link

I'm trying to convert this Date format to Jalali: "Jan 11, 2023 4:28:24 PM"
This is my code:
moment("Jan 11, 2023 4:28:24 PM", "MMM DD, YYYY h:mm:ss a").locale("fa-IR").format("jYYYY/jMM/jDD h:mm")
And I get an Invalid date exception.
According to moment js document, the three-letter month (for example "Jan") must use the "MMM" string format, but it's not working.

Note:

The Invalid Date is for the three-letter month, and if I remove it, will be ok.

@behrang
Copy link
Member

behrang commented Apr 2, 2023

I tried your code and I got this:

'۱۴۰۱/۱۰/۲۱ ۴:۲۸'

@vahida1157
Copy link
Author

I don't know if it is related, but did you use a typescript version?!

@behrang
Copy link
Member

behrang commented Apr 3, 2023

No, just used a node REPL.

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

2 participants