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

Date interval calculation logic is incorrect #55

Open
NingQue0920 opened this issue Sep 19, 2023 · 0 comments
Open

Date interval calculation logic is incorrect #55

NingQue0920 opened this issue Sep 19, 2023 · 0 comments

Comments

@NingQue0920
Copy link

func (d diff) InDays() int { return absFloor(math.Floor(float64(d.InHours()) / 24)) }

this method should return absFloor(float64(d.InHours()) / 24) 。
When the value of float64(d.InHours()) / 24 is negative, math.Floor() will calculate the nearest negative integer but less than float64(d.InHours()) / 24, the absFloor is meaningless

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant