fixed wrong day-of-week in calendar
authorPhiTux <redacted>
Wed, 22 Oct 2025 16:55:41 +0000 (18:55 +0200)
committerPhiTux <redacted>
Wed, 22 Oct 2025 16:55:41 +0000 (18:55 +0200)
frontend/src/lib/Datepicker.svelte

index eac204e92c00b82153448b1e1a18347bf16481b4..1fd44477ce697b4ba275f551af3411ebd4a50f79 100644 (file)
        let lastYear = $cal.currentYear;
 
        $effect(() => {
-               if ($cal.currentMonth !== lastMonth || $cal.currentYear !== lastYear) {
+               if (
+                       ($cal.currentMonth !== lastMonth || $cal.currentYear !== lastYear) &&
+                       $settings.firstDayOfWeek !== undefined
+               ) {
+                       console.log($settings.firstDayOfWeek);
                        // set animation direction
                        animationDirection = $cal.currentMonth > lastMonth ? 1 : -1;
                        if ($cal.currentYear > lastYear) {
                }
        });
 
-       onMount(() => {
-               days = updateCalendar();
+       let firstDayOfWeekInitialized = false;
+       $effect(() => {
+               if (!firstDayOfWeekInitialized && $settings.firstDayOfWeek !== undefined) {
+                       days = updateCalendar();
+                       firstDayOfWeekInitialized = true;
+               }
+       });
 
+       onMount(() => {
                oc = document.querySelector('.offcanvas');
                oc.addEventListener('hidden.bs.offcanvas', () => {
                        $offcanvasIsOpen = false;
git clone https://git.99rst.org/PROJECT