* add localeaware Date.getLocaleDay method and reorder week days array
 * calendars should now have a region approriate first day of the week
This commit is contained in:
Sarjuuk 2026-01-11 18:46:37 +01:00
parent ce020204cb
commit 03fb4045dc
7 changed files with 21 additions and 5 deletions

View file

@ -0,0 +1 @@
UPDATE `aowow_dbversion` SET `build` = CONCAT(IFNULL(`build`, ''), ' globaljs');

View file

@ -3,6 +3,21 @@
'abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video'.replace(/\w+/g,function(n){document.createElement(n)})
// aowow - extend Date for holidaycal
Date.prototype.getLocaleDay = function() {
const dayNo = this.getDay();
switch (Locale.getId())
{
case LOCALE_FRFR:
case LOCALE_DEDE:
case LOCALE_ESES:
case LOCALE_RURU:
return !dayNo ? 6 : dayNo - 1;
default:
return dayNo;
}
};
/*
User-related functions
TODO: Move global variables/functions into User class

View file

@ -1098,7 +1098,7 @@ Listview.prototype = {
$WH.ae(this.tbody, tr);
tr = $WH.ce('tr');
for (var k = 0; k < this.dates[starti].date.getDay(); ++k)
for (var k = 0; k < this.dates[starti].date.getLocaleDay(); ++k)
{
var foo = $WH.ce('td');
foo.className = 'empty-cell';