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

Added time tracking clamping setting #149

Closed
wants to merge 14 commits into from

Conversation

dmartingit
Copy link

No description provided.

@@ -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
Copy link
Member

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.

Copy link
Member

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?

Copy link
Author

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.

@dmartingit dmartingit closed this Aug 30, 2021
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

Successfully merging this pull request may close these issues.

2 participants