mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-24 04:00:59 +01:00
web: prevent setting reminder time before current time
This commit is contained in:
committed by
Abdullah Atta
parent
d0991ae96b
commit
6e1db2ea33
@@ -179,6 +179,15 @@ export default function AddReminderDialog(props: AddReminderDialogProps) {
|
||||
}
|
||||
|
||||
const dateTime = dayjs(getDateTime(date, time));
|
||||
|
||||
if (dateTime.isBefore(dayjs())) {
|
||||
showToast(
|
||||
"error",
|
||||
"Reminder time cannot be earlier than the current time."
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
await db.reminders?.add({
|
||||
id: reminderId,
|
||||
recurringMode,
|
||||
|
||||
Reference in New Issue
Block a user