Skip to content

Commit

Permalink
only use min break time if there is at least one break
Browse files Browse the repository at this point in the history
  • Loading branch information
hardliner66 committed Apr 19, 2021
1 parent b269249 commit 2bb5124
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "timetracking"
description = "Simple time tracker with simple data format"
version = "1.5.15-alpha.0"
version = "1.5.15"
authors = ["hardliner66 <[email protected]>"]
edition = "2018"
license-file = "LICENSE"
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ fn get_time_from_day(
let total = last.unwrap_or(now) - first.unwrap_or(now);
let pause = total - work_day;
let min_break_duration = Duration::minutes(i64::from(settings.min_daily_break));
if pause < min_break_duration {
if pause > Duration::zero() && pause < min_break_duration {
let difference = min_break_duration - pause;
work_day = work_day - difference;
}
Expand Down

0 comments on commit 2bb5124

Please sign in to comment.