-
Notifications
You must be signed in to change notification settings - Fork 56
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
[RFC][UN-13487] Fix diff in months #43
Conversation
88ae08c
to
dc615c0
Compare
carbon.go
Outdated
@@ -1187,7 +1187,7 @@ func (c *Carbon) DiffInMonths(carb *Carbon, abs bool) int64 { | |||
if (diffHr - hrLastMonth) >= 0 { | |||
var m int64 | |||
if c.Year() < carb.Year() { | |||
m = (int64(monthsPerYear) - int64(c.In(time.UTC).Month())) + (int64(carb.In(time.UTC).Month()) - 1) | |||
m = int64(monthsPerYear) - int64(c.In(time.UTC).Month()) + int64(carb.In(time.UTC).Month()) - 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go was giving a error reporting redundant parameters
Codecov Report
@@ Coverage Diff @@
## master #43 +/- ##
==========================================
- Coverage 91.49% 91.48% -0.01%
==========================================
Files 3 3
Lines 858 857 -1
==========================================
- Hits 785 784 -1
Misses 48 48
Partials 25 25
Continue to review full report at Codecov.
|
5fc365d
to
7761d0b
Compare
Issue
https://uniplaces.atlassian.net/browse/UN-13487
What this does?
13
and when summed with years' difference would count a year twicediffInMonths
from php carbon` tests check here