Skip to content

Commit

Permalink
Merge pull request #175 from traggo/set-to-zero
Browse files Browse the repository at this point in the history
fix: reset seconds to 0 when manually editing
  • Loading branch information
jmattheis authored Jul 30, 2024
2 parents c581a90 + 522c138 commit 9a9d897
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ui/src/timespan/TimeSpan.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ export const TimeSpan: React.FC<TimeSpanProps> = React.memo(
if (!newFrom.isValid()) {
return;
}
newFrom.set({second: 0});
if (to && moment(newFrom).isAfter(to)) {
const newTo = moment(newFrom).add(15, 'minute');
noteAwareUpdateTimeSpan({
Expand Down Expand Up @@ -217,6 +218,7 @@ export const TimeSpan: React.FC<TimeSpanProps> = React.memo(
if (!newTo.isValid()) {
return;
}
newTo.set({second: 0});
if (moment(newTo).isBefore(from)) {
const newFrom = moment(newTo).subtract(15, 'minute');
noteAwareUpdateTimeSpan({
Expand Down

0 comments on commit 9a9d897

Please sign in to comment.