Skip to content

Commit

Permalink
fix: reset seconds to 0 when manually editing
Browse files Browse the repository at this point in the history
  • Loading branch information
jmattheis committed Jul 25, 2024
1 parent c581a90 commit 522c138
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 522c138

Please sign in to comment.