From 0212b9d2e7e3817e178a8dce88126d9b7e8a3fb7 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Sun, 12 Apr 2026 14:10:48 +0200 Subject: [PATCH] Add function to assert project time settings are ordered --- src/app/App.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/App.tsx b/src/app/App.tsx index a14a1047..8dbb79b4 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -754,6 +754,12 @@ function readPositiveNumberDraft(source: string, label: string): number { return value; } +function assertProjectTimeSettingsAreOrdered(time: ProjectTimeSettings) { + if (time.sunriseTimeOfDayHours >= time.sunsetTimeOfDayHours) { + throw new Error("Project sunrise must be earlier than project sunset."); + } +} + function areVec2Equal(left: Vec2, right: Vec2): boolean { return left.x === right.x && left.y === right.y; }