-
Notifications
You must be signed in to change notification settings - Fork 30
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
Added time tracking clamping setting #149
Conversation
@@ -42,6 +46,21 @@ def round_interval(time_interval, project: nil) | |||
end | |||
end | |||
|
|||
def clamp?(start, project: nil) | |||
clamp_limit = clamp_limit project: project | |||
stop = Time.now.change(sec: 0) + 1.minute |
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.
This looks like we need actual rounding here?
The +1.minute seems wrong when seconds were 0 before: "0min 0sec" => "1min 0sec".
In lib/ Hourglass::DateTimeCalculation is the "rounding" logic used for booking.
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.
Why are we doing rounding for sub minutes here? is it actually necessary?
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.
It is the behavior how time logs are updated currently. This is the reason why clamp should also use the "rounded" stop time.
Additionally we always add 1 minute to prevent a time tracked which is less then one.
No description provided.