setup.alarmClockNextAlarm ??= function(){
	const time = State.variables.time;

	const alarmClockSettings = State.variables.alarmClock;

	const [timer, timerM, timerEnd, timeEndM,holidayIsWeekend] = [
		parseInt(alarmClockSettings.hour),
		parseInt(alarmClockSettings.minute),
		parseInt(alarmClockSettings.hourWeekend),
		parseInt(alarmClockSettings.minuteWeekend),
		alarmClockSettings.holidayIsWeekend
	];
	let nextAlarm = time.now;

	if(nextAlarm.getUTCDay() == 0 || nextAlarm.getUTCDay() == 6 || (holidayIsWeekend && time.dateIsSchoolHoliday(nextAlarm)))
		nextAlarm.setUTCHours(timerEnd,timeEndM,0,0);
	else
		nextAlarm.setUTCHours(timer,timerM,0,0);

	let i = 0;
	while(!time.isFuture(nextAlarm) && i++ < 1000){
		nextAlarm.setUTCDate(nextAlarm.getUTCDate()+1);
		if(nextAlarm.getUTCDay() == 0 || nextAlarm.getUTCDay() == 6)
			nextAlarm.setUTCHours(timerEnd,timeEndM,0,0);
		else
			nextAlarm.setUTCHours(timer,timerM,0,0);
	}
	return nextAlarm;
}