[TikiWiki-commits] [Git][tikiwiki/tiki][30.x] [BP][FIX] Calendar: ensure weekday headers match the configured first day of the week
"MAGENE Sem Joel \(@Jomagene\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <6a3eb56ce0a76_3819a2e474916@gitlab-sidekiq-low-urgency-cpu-bound-v2-dd678b676-s7jbv.mail> |
MAGENE Sem Joel pushed to branch 30.x at Tiki Wiki CMS Groupware / Tiki
Commits:
4416658f by MAGENE Sem Joel at 2026-06-26T17:16:46+00:00
[BP][FIX] Calendar: ensure weekday headers match the configured first day of the week
---
* [FIX] Calendar: ensure weekday headers match the configured first day of the week
---
* [FIX] Calendar: ensure weekday headers match the configured first day of the week
See merge request tikiwiki/tiki!10599
(cherry picked from commit 2e9d303be34e1091fe50e6167f0d099f25903a9b)
See merge request tikiwiki/tiki!10608
- - - - -
3 changed files:
- lib/calendar/calendarlib.php
- lib/test/Calendar/DateTest.php
- src/js/jquery-tiki/tiki-calendar.js
Changes:
=====================================
lib/calendar/calendarlib.php
=====================================
@@ -178,7 +178,7 @@ class CalendarLib extends TikiLib
}
return [
'timeFormat' => $prefs['display_12hr_clock'] === 'y',
- 'firstDayofWeek' => 0,//$firstDayofWeek,
+ 'firstDayofWeek' => $this->firstDayofWeek(),
'display_timezone' => $prefs['display_timezone'],
'language' => $prefs['language'],
'minHourOfDay' => $minHourOfDay,
@@ -1658,7 +1658,7 @@ class CalendarLib extends TikiLib
} else {
$firstDayofWeek = $prefs['calendar_firstDayofWeek'];
}
- return $firstDayofWeek;
+ return (int) $firstDayofWeek;
}
// return detail on a date
/**
=====================================
lib/test/Calendar/DateTest.php
=====================================
@@ -60,6 +60,23 @@ class Calendar_DateTest extends TikiTestCase
$this->assertEquals('2010-09-05', TikiLib::date_format('%Y-%m-%d', $cell[5][6]['date']));
}
+ public function testFirstDayOfWeekReturnsIntegerForExplicitPreference(): void
+ {
+ global $prefs;
+ $calendarlib = TikiLib::lib('calendar');
+ $originalPreference = $prefs['calendar_firstDayofWeek'];
+
+ try {
+ $prefs['calendar_firstDayofWeek'] = '0';
+ $this->assertSame(0, $calendarlib->firstDayofWeek());
+
+ $prefs['calendar_firstDayofWeek'] = '1';
+ $this->assertSame(1, $calendarlib->firstDayofWeek());
+ } finally {
+ $prefs['calendar_firstDayofWeek'] = $originalPreference;
+ }
+ }
+
public function testPrevious(): void
{
global $tikilib;
=====================================
src/js/jquery-tiki/tiki-calendar.js
=====================================
@@ -328,7 +328,7 @@ $.fn.setupEventCalendar = function (
removeMonthRangeControls();
removeListPeriodControls();
if (currentViewType == "timeGridWeek" || currentViewType == "listWeek") {
- calendarContainer[0].setOption("duration", { days: 7 });
+ calendarContainer[0].setOption("duration", { weeks: 1 });
calendarContainer[0].setOption("dayCellFormat", function (dayCell) {
return moment(dayCell).format("D");
});
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/4416658f496ce01d783fab90f11612ea46214493
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/4416658f496ce01d783fab90f11612ea46214493
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs