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';
interface NotificationType {
key: 'dayBefore' | 'sameDay' | 'pickup';
key: string;
label: string;
defaultTime: string;
minTime?: string;
@ -131,8 +131,8 @@ export default function CategoryScreen() {
Message.error( t( "notifications-before-16-00" ) );
return;
}
} else if (notification.minTime) {
const maxDate = new Date( `1970-01-01T${notification.minTime}` );
} else if (notification.maxTime) {
const maxDate = new Date( `1970-01-01T${notification.maxTime}` );
if (maxDate < selectedDate) {
Message.error( t( "notifications-after-09-00" ) );
return;