Skip to content

Commit

Permalink
Merge pull request #1130 from JGreenlee/fix-reminder-time
Browse files Browse the repository at this point in the history
🩹 fix crash on updatePrefReminderTime
  • Loading branch information
shankari authored Feb 20, 2024
2 parents dcb6957 + e84e816 commit 034bee2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions www/js/control/ProfileSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,10 @@ const ProfileSettings = () => {
if (!uiConfig?.reminderSchemes)
return logWarn('In updatePrefReminderTime, no reminderSchemes yet, skipping');
if (storeNewVal) {
const m = DateTime.fromISO(newTime);
const dt = DateTime.fromJSDate(newTime);
// store in HH:mm
setReminderPrefs(
{ reminder_time_of_day: m.toFormat('HH:mm') },
{ reminder_time_of_day: dt.toFormat('HH:mm') },
uiConfig.reminderSchemes,
isScheduling,
setIsScheduling,
Expand Down
6 changes: 5 additions & 1 deletion www/js/splash/notifScheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ const calcNotifTimes = (scheme, dayZeroDate, timeOfDay): DateTime[] => {
.plus({ days: d })
.toFormat('yyyy-MM-dd');
const notifTime = DateTime.fromFormat(date + ' ' + timeOfDay, 'yyyy-MM-dd HH:mm');
notifTimes.push(notifTime);
if (notifTime.isValid) {
notifTimes.push(notifTime);
} else {
displayErrorMsg('Cannot schedule notifs with invalid time of day: ' + timeOfDay);
}
}
}
return notifTimes;
Expand Down

0 comments on commit 034bee2

Please sign in to comment.