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

Farvardin 2, is not recognized! #203

Open
babakrkb opened this issue Mar 28, 2020 · 3 comments
Open

Farvardin 2, is not recognized! #203

babakrkb opened this issue Mar 28, 2020 · 3 comments

Comments

@babakrkb
Copy link

babakrkb commented Mar 28, 2020

The object for the second day of Farvardin is always as the same object for the first day of Farvardin for all years. For example:

moment("1398/01/02", "jYYYY/jMM/jDD").format("jYYYY/jMM/jDD") // retruns 1389/01/01

I should mention that I am using this package on an android phone using React-native. I have not this propblem in the node server. The propblem only exists on the phone

What can I do for this propblem?

@behrang
Copy link
Member

behrang commented Mar 30, 2020

It must be a timezone problem. What is the location of your android phone?

@babakrkb
Copy link
Author

babakrkb commented Apr 6, 2020

Yes it is a timezone problem. When I change it to US timezone, it works fine, but when I change the timezone to Tehran, It does not work properly.

@behrang
Copy link
Member

behrang commented Apr 7, 2020

Add 12 hour to your input string, and parse that too. This is a way to have enough offset, so timezones cannot interfere.

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