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

Set hour(0) not working #66

Open
mort3za opened this issue Mar 22, 2019 · 1 comment
Open

Set hour(0) not working #66

mort3za opened this issue Mar 22, 2019 · 1 comment

Comments

@mort3za
Copy link
Collaborator

mort3za commented Mar 22, 2019

I think there is a bug in .hour(number):
new persianDate([1397,1 ,1 , 2]).hour(0).format()
Should return "۱۳۹۷-۰۱-۰۱ ۰۰:۰۰:۰۰ ق ظ"
But returns ۱۳۹۷-۰۱-۰۱ ۰۲:۰۰:۰۰ ق ظ (same as input)

Same issue for other similar methods such as .minute(), ...

@mort3za mort3za changed the title Set hour(0) not works Set hour(0) not working Mar 22, 2019
@mokhosh
Copy link

mokhosh commented Sep 16, 2019

i had the same problem with second(0).
after scratching my head for a good couple of minutes i guessed that the issue is related to javascript treating 0 as a falsy value and recognizing second(0) as a getter and not a setter. so i did this as a work around and it works: second('0')
just wrap 0 in a string.

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