소스 검색

refactor `budilnik`

Stephan Fuchs 11 달 전
부모
커밋
148638e9d9
2개의 변경된 파일5개의 추가작업 그리고 11개의 파일을 삭제
  1. 4 10
      sugarcube/src/autogenerated/unsorted/budilnik.tw
  2. 1 1
      sugarcube/src/js/alarmClock.js

+ 4 - 10
sugarcube/src/autogenerated/unsorted/budilnik.tw

@@ -1,13 +1,7 @@
-:: budilnik
-<<set $here = 'budilnik'>>
-<<set $menu_off = 1>>
-<<if $location_var[$here][0] == 'start'>>
+:: budilnik[menu]
 	<<image "shared/home/bedroom/bed2.jpg">>
 	<p><<checkbox "$budilnikOn" 0 1 autocheck>> Turned on.</p>
-	<p>Timer (Weekday): <<textbox "$timer" $timer>>:<<textbox "$timerM" $timerM>></p>
-	<p>Timer (Weekend): <<textbox "$timerEnd" $timerEnd>>:<<textbox "$timerEndM" $timerEndM>></p>
+	<p>Timer (Weekday): <<numberbox "$timer" $timer>>:<<numberbox "$timerM" $timerM>></p>
+	<p>Timer (Weekend): <<numberbox "$timerEnd" $timerEnd>>:<<numberbox "$timerEndM" $timerEndM>></p>
 	<p><<checkbox "$alarm_holiday" 0 1 autocheck>> <b>Use weekend alarm for holidays</b></p>
-	<<actCLA 'Finish'>>
-		<<gt $location>>
-	<</actCLA>>
-<</if>>
+	<<ret 'Finish'>>

+ 1 - 1
sugarcube/src/js/alarmClock.js

@@ -8,7 +8,7 @@ setup.alarmClockNextAlarm ??= function(){
 	];
 	let nextAlarm = time.now;
 
-	if(nextAlarm.getUTCDay() == 0 || nextAlarm.getUTCDay() == 6)
+	if(nextAlarm.getUTCDay() == 0 || nextAlarm.getUTCDay() == 6 || (State.variables.alarm_holiday && time.dateIsSchoolHoliday(nextAlarm)))
 		nextAlarm.setUTCHours(timerEnd,timeEndM,0,0);
 	else
 		nextAlarm.setUTCHours(timer,timerM,0,0);