Einheit für Erinnerung hinzugefügt

This commit is contained in:
2026-01-08 10:10:41 +01:00
parent 6edddb8249
commit 132b571798
2 changed files with 6 additions and 6 deletions

View File

@@ -244,7 +244,7 @@ function normalizeJournalReminder(reminder = {}) {
? Math.max(0, parsedBeforeValue) ? Math.max(0, parsedBeforeValue)
: Number.isFinite(parsedDaysBefore) : Number.isFinite(parsedDaysBefore)
? Math.max(0, parsedDaysBefore) ? Math.max(0, parsedDaysBefore)
: 42; : 6;
const daysBefore = unit === 'weeks' ? beforeValue * 7 : unit === 'months' ? beforeValue * 30 : beforeValue; const daysBefore = unit === 'weeks' ? beforeValue * 7 : unit === 'months' ? beforeValue * 30 : beforeValue;
return { return {
enabled: !!reminder.enabled, enabled: !!reminder.enabled,

View File

@@ -52,8 +52,8 @@ const JournalPage = ({ authorizedFetch, stores }) => {
note: '', note: '',
reminderEnabled: true, reminderEnabled: true,
reminderInterval: 'yearly', reminderInterval: 'yearly',
reminderBeforeValue: 42, reminderBeforeValue: 6,
reminderBeforeUnit: 'days' reminderBeforeUnit: 'weeks'
}); });
const [images, setImages] = useState([]); const [images, setImages] = useState([]);
const [existingImages, setExistingImages] = useState([]); const [existingImages, setExistingImages] = useState([]);
@@ -124,7 +124,7 @@ const JournalPage = ({ authorizedFetch, stores }) => {
? Math.max(0, rawValue) ? Math.max(0, rawValue)
: Number.isFinite(fallbackValue) : Number.isFinite(fallbackValue)
? Math.max(0, fallbackValue) ? Math.max(0, fallbackValue)
: 42; : 6;
return { unit, value }; return { unit, value };
}, []); }, []);
@@ -341,8 +341,8 @@ const JournalPage = ({ authorizedFetch, stores }) => {
note: '', note: '',
reminderEnabled: true, reminderEnabled: true,
reminderInterval: 'yearly', reminderInterval: 'yearly',
reminderBeforeValue: 42, reminderBeforeValue: 6,
reminderBeforeUnit: 'days' reminderBeforeUnit: 'weeks'
}); });
}, [images]); }, [images]);