fingerpich / jalali-moment

Display, parse, manipulate, validate and convert jalali (Persian, Khorshidi, Shamsi) or Gregorian (Miladi) dates and times.
https://fingerpich.github.io/jalali-moment/
MIT License
436 stars 68 forks source link

The last day of Shari var, YYYY/06/31, is not valid date #60

Closed rezashami closed 4 years ago

rezashami commented 5 years ago

Describe the bug When I use moment with this syntax, the program say "the date is not valid": var miladiDate=moment("1397-06-31", 'YYYY-MM-DD'); // miladiDate is invalid date Is there any way for convert this date to gregorian date? Thank you for your answers.

P.S: I use node.js version 10.15.1 and the latest version of jalali-moment

fingerpich commented 5 years ago

Hi, thanks please provide a stackblitz demo.

rezashami commented 5 years ago

Hi, thanks please provide a stackblitz demo.

https://stackblitz.com/edit/react-4aeamf?embed=1&file=Moment

pouyamiralayi commented 5 years ago

Hi! where is the code related to this problem? i would be happy to contribute. Thanks!

rezafrad commented 5 years ago

Hi! there is a bug converting 1398-08-09. instead of 2019-10-31 returns 2019-11-01

fingerpich commented 4 years ago

Hi, thanks please provide a stackblitz demo.

https://stackblitz.com/edit/react-4aeamf?embed=1&file=Moment

you have to use jmoment.locale('fa') at first or use jmoment.from('1397-06-29', 'fa', 'YYYY-MM-DD') to read the input as a jalali time demo

fingerpich commented 4 years ago

Hi! there is a bug converting 1398-08-09. instead of 2019-10-31 returns 2019-11-01

I have tested it and it works well demo