web: prevent setting reminder time before current time

This commit is contained in:
Abdullah Atta
2023-01-04 12:18:02 +05:00
committed by Abdullah Atta
parent d0991ae96b
commit 6e1db2ea33

View File

@@ -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,