getMonthsBetween inconsitency
See original GitHub issueI’m confused to the fact why this returns two separate results.
> var now = new Date()
> var twoMonths = new Date().addMonths(2)
> now.getMonthsBetween(twoMonths)
2.033333333333333
> twoMonths.getMonthsBetween(now)
1.0333299999999999
I assume they’d be the same with a result of 2.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Difference between 2 calendar instances giving inconsistent ...
I'm using jdk 1.7 and using the Calendar class to calculate the difference between 2 dates. I'm using the below code but it...
Read more >GNU Date: inconsistency calculating number of days between ...
It seems that up to March I get the expected answer (i.e., I get Nov 20 in the fourth command), but from April...
Read more >Inconsistency between addMonths & differenceInMonths for ...
There is inconsistency in functions within date-fns that deal with months. We should expect differenceInMonths(addMonths(x, 1), ...
Read more >How should I calculate my income if it's inconsistent ... - Upsolve
How should I calculate my income if it's inconsistent from month to month? · There are two different times that you have to...
Read more >How to count number of calendar months between dates
I am trying to calculate the number of calendar months between two dates. My current formula is: =DATEDIF(EOMONTH(Date1), EOMONTH(Date2), ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That’s a darned good question.
it was actually done 6 days ago, but i just found that i hadn’t hit “comment” on the comment.