Set min and max time for notifications
This commit is contained in:
parent
ad990ca528
commit
ad1640e8f2
1 changed files with 18 additions and 0 deletions
|
@ -80,6 +80,8 @@ export default function CategoryScreen() {
|
||||||
onChange,
|
onChange,
|
||||||
mode: 'time',
|
mode: 'time',
|
||||||
is24Hour: true,
|
is24Hour: true,
|
||||||
|
positiveButton: { label: 'Kies' },
|
||||||
|
negativeButton: { label: 'Sluiten' },
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,6 +94,22 @@ export default function CategoryScreen() {
|
||||||
const minutes = selectedDate.getMinutes().toString().padStart( 2, '0' );
|
const minutes = selectedDate.getMinutes().toString().padStart( 2, '0' );
|
||||||
const timeString = `${hours}:${minutes}`;
|
const timeString = `${hours}:${minutes}`;
|
||||||
|
|
||||||
|
if (currentEdit === 'dayBefore') {
|
||||||
|
const minDate = new Date( `1970-01-01T16:00` );
|
||||||
|
if (minDate > selectedDate) {
|
||||||
|
Message.error( 'Meldingen voor 16:00 worden niet ondersteund' );
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const minDate = new Date( `1970-01-01T09:00` );
|
||||||
|
if (minDate < selectedDate) {
|
||||||
|
Message.error( 'Meldingen na 09:00 worden niet ondersteund' );
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (currentEdit === 'dayBefore') {
|
if (currentEdit === 'dayBefore') {
|
||||||
setDayBefore( timeString );
|
setDayBefore( timeString );
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue