-
Notifications
You must be signed in to change notification settings - Fork 30
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
Add addYears
and addMonths
#11
Conversation
I also seem to get failing tests locally on latest master (before my commit):
|
So I've found out what is causing the tests to fail but I don't understand why. I noticed you're doing everything in the EET timezone but my Mac is running in British English. I'm getting some strange results like the following when using > new Date('Mon Jan 18 2016 13:07:17 GMT+0100 (BST)').toString()
'Mon Jan 18 2016 12:07:17 GMT+0000 (GMT)'
> new Date('Mon Jan 18 2016 14:07:17 GMT+0200 (EET)').toString()
'Mon Jan 18 2016 12:07:17 GMT+0000 (GMT)'
> new Date().toString()
'Fri Apr 01 2016 11:07:52 GMT+0100 (BST)' It's forcing things into UTC unless I use the empty |
Thanks for the PR! ✋ Yeah, I left them out because the days in months and years are changing. Could you add some more tests to see what happens when you add 11/12 months for instance. Does the year change, will the month stay the same when adding 12 months? Any ideas why your tests might be failing? In which timezone are you? |
Good find! I don't have time right now to fix the timezone toString bug but I will take a look at it later. |
Yeah, I will add more tests. I noticed you have |
Thanks! |
Hi @herkyl, I've added the extra tests you wanted. |
Thanks! Published as 0.3.0 |
I'm not sure if you left these out on purpose but I needed them and thought I would add them. I wasn't able to write them using
addMilliseconds
as obviously months and years can have a different amount of milliseconds in them.