School Schedule Engine
System LogicVerifiedShare on
The pure restriction function.
HM Redowan1 min readUpdated 2026-12-04
Bu sayfanın Türkçe çevirisi editör incelemesinde. İngilizce sürüm gösteriliyor.
ts
computeRestriction({ now, isBoarding, schedules, holidays, unlocks })
// → { restricted, reason: "schedule" | "holiday" | "unlock" | "free", schedule? }- Convert
nowto Europe/Istanbul date, minutes and ISO weekday. - Find the first schedule that is active, in scope, lists today, and
start <= now < end. - None →
free. - Holiday today and scope
all→holiday. - Approved unlock with
starts_at <= now < ends_at→unlock. - Else →
schedule(restricted).
Bu sayfa yardımcı oldu mu?