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

DiffInMonths does not consider the positive and negative of the time period #154

Closed
almas1992 opened this issue Sep 19, 2022 · 2 comments
Closed
Labels
Fixed Bug fixed

Comments

@almas1992
Copy link
Contributor

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!

@almas1992 almas1992 added the Bug Report a reproducible bug or regression label Sep 19, 2022
@Issues-translate-bot Issues-translate-bot changed the title DiffInMonths 未考虑时间段的正负 DiffInMonths does not consider the positive and negative of the time period Sep 19, 2022
@gouguoyin
Copy link
Collaborator

Thanks, it will be fixed in the next version.

@gouguoyin
Copy link
Collaborator

gouguoyin commented Oct 27, 2022

It has been fixed in 1.7.0 or 2.2.0

@gouguoyin gouguoyin added Fixed Bug fixed and removed Bug Report a reproducible bug or regression labels Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed Bug fixed
Projects
None yet
Development

No branches or pull requests

2 participants