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
I looked into the library and it seems that the add function refers to the moment library itself when the unit of addition is in 'day's.
I think the moment library adds the one day, based on its own timezone, and not based on jalali's timezone.
The problem is that, this function should not refer to other timezones because it corrupts the calculations. this is jalali calendar, and it should refer to its own timezone for calculations.
moment is considering timezone when adding days. The date that you said is the day that Daylight Saving Time is activated in Iran (until last year). The calculation is correct if you consider hours and timezone changes.
If you only want to work with dates, you may use jalaali-js.
Hello
moment('1401/1/1', 'jYYYY/jMM/jDD').add(1, 'day');
moment('1402/1/1', 'jYYYY/jMM/jDD').add(1, 'day');
moment('1403/1/1', 'jYYYY/jMM/jDD').add(1, 'day');
moment('1404/1/1', 'jYYYY/jMM/jDD').add(1, 'day');
moment('1405/1/1', 'jYYYY/jMM/jDD').add(1, 'day');
moment('1406/1/1', 'jYYYY/jMM/jDD').add(1, 'day');
moment('1407/1/1', 'jYYYY/jMM/jDD').add(1, 'day');
expected outcome is '140x/1/2', but returns '140x/1/1';
any of these add functions return the same date. it only happens on the first day of the year.
The text was updated successfully, but these errors were encountered: