Skip to content

Commit

Permalink
[RAM] Remove restriction on setting a start time in the past on Snooz…
Browse files Browse the repository at this point in the history
…e Scheduler UI (#168160)

## Summary

Closes #167176

Sets the minimum date in the snooze scheduler datepicker to the current
date at `00:00`. This is useful especially when the user is trying to
create a recurring schedule that starts today, and should start at a
time earlier than the current time on future occurrences.
  • Loading branch information
Zacqary authored Oct 13, 2023
1 parent 6d34491 commit 530cdf1
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,15 @@ const RuleSnoozeSchedulerPanel: React.FunctionComponent<PanelOpts> = ({
const minDate = useMemo(
// If the initial schedule is earlier than now, set minDate to it
// Set minDate to now if the initial schedule is in the future
() => moment.min(moment(), moment(initialSchedule?.rRule.dtstart ?? undefined)),
() =>
moment
.min(moment(), moment(initialSchedule?.rRule.dtstart ?? undefined))
// Allow the time on minDate to be earlier than the current time
// This is useful especially when the user is trying to create a recurring schedule
// that starts today, and should start at a time earlier than the current time on future
// occurrences
.hour(0)
.minute(0),
[initialSchedule]
);

Expand Down

0 comments on commit 530cdf1

Please sign in to comment.