JS/Date
* 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:
parent
ce020204cb
commit
03fb4045dc
7 changed files with 21 additions and 5 deletions
1
setup/sql/updates/1768155583_01.sql
Normal file
1
setup/sql/updates/1768155583_01.sql
Normal file
|
|
@ -0,0 +1 @@
|
|||
UPDATE `aowow_dbversion` SET `build` = CONCAT(IFNULL(`build`, ''), ' globaljs');
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue