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

Inconsistency when parsing month #83

Open
alexfauquette opened this issue Nov 4, 2022 · 5 comments
Open

Inconsistency when parsing month #83

alexfauquette opened this issue Nov 4, 2022 · 5 comments

Comments

@alexfauquette
Copy link

I'm working on adapting the moment-hijri for mui date pickers, but I'm facing an issue when parsing months. the value is neither correctly recognized.

I made a codesandbox where I test if the function x => format(parse(format(x))) is the identity. But it's not the case.

With strict parsing, it's an invalid date and with loose parsing, it always returns 12

https://codesandbox.io/s/cranky-shadow-u3sv6g?file=/demo.tsx

Not sure if it's a bug or I'm using the library in a wrong way

@xcode-it
Copy link

xcode-it commented Jul 5, 2023

hey there,

Fixed the issue. Here's an updated sandbox code

https://codesandbox.io/s/hungry-joji-3y7gm5?file=/demo.tsx

**There is still an issue of month name doesn't correspond to actual month after parsing (woking on it).

@xcode-it
Copy link

xcode-it commented Jul 5, 2023

The array month naming in moment-hejri starts counting from 1, while in moment starts from 0

all issues fixed.

https://codesandbox.io/s/hungry-joji-3y7gm5?file=/demo.tsx

@alexfauquette
Copy link
Author

Thanks

We will start again the migration of the adapter

@xcode-it
Copy link

xcode-it commented Jul 7, 2023

there was an issue with moment-hijri when used with @inertiajs/react

TypeError: moment.localeData is not a function

fixed it
https://github.com/anon-phantom/hijri

@mahmoudelgamal
Copy link

mahmoudelgamal commented May 26, 2024

there was an issue with moment-hijri when used with @inertiajs/react

TypeError: moment.localeData is not a function

fixed it https://github.com/anon-phantom/hijri

@anon-phantom the link is broken it's redirect me to 404 page

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

3 participants