carbon
carbon copied to clipboard
DiffInMonths does not consider the positive and negative of the time period
Hello,
I encountered an issue with the following code:
carbon.Parse("2022-08-08 22:55:15").DiffInMonths(carbon.Parse("2022-09-18 22:55:19"))
carbon.Parse("2022-09-18 22:55:19").DiffInMonths(carbon.Parse("2022-08-08 22:55:15"))
golang version: sgo1.19.1 darwin/arm64
carbon version: v2.1.9
time zone: such as Japan
I expected to get:
1
-1
But I actually get:
1
-2
Thanks!
Thanks, it will be fixed in the next version.
It has been fixed in 1.7.0 or 2.2.0