Fix notifications max time check

This commit is contained in:
Maarten 2024-09-10 13:48:29 +02:00
parent 1f3e0596b1
commit 1e5afda77c

View file

@ -17,7 +17,7 @@ import { setSession } from '@/src/store/dataStore';
import { ThemedIcon } from '@/src/components/themed/ThemedIcon'; import { ThemedIcon } from '@/src/components/themed/ThemedIcon';
interface NotificationType { interface NotificationType {
key: 'dayBefore' | 'sameDay' | 'pickup'; key: string;
label: string; label: string;
defaultTime: string; defaultTime: string;
minTime?: string; minTime?: string;
@ -131,8 +131,8 @@ export default function CategoryScreen() {
Message.error( t( "notifications-before-16-00" ) ); Message.error( t( "notifications-before-16-00" ) );
return; return;
} }
} else if (notification.minTime) { } else if (notification.maxTime) {
const maxDate = new Date( `1970-01-01T${notification.minTime}` ); const maxDate = new Date( `1970-01-01T${notification.maxTime}` );
if (maxDate < selectedDate) { if (maxDate < selectedDate) {
Message.error( t( "notifications-after-09-00" ) ); Message.error( t( "notifications-after-09-00" ) );
return; return;