[FIX] web: wrong day column title in arabic

In arabic, with the version localization of bootstrap we use the week
starts on saturday. But the version of bootstrap-datetimepicker we use
in 10.0 and saas-14 is 3.0.3 which only fully supports week starting
on sunday and monday.

Thus in arabic, the column title in the date picker would be:

  Sunday <- Monday (ﻥ, ﺙ, ﺭ, ﺥ, ﺝ, ﺱ, ﺡ)

Instead of what the numbered days in the calendar are shown as:
  Friday <- Saturday (ﺱ, ﺡ, ﻥ, ﺙ, ﺭ, ﺥ, ﺝ)

This issue doesn't happen in saas-15, 11.0 and over since the library
has been updated with ad6fd5f8 and the as of version 4 supports any
starting day of week, with this change:
 https://github.com/Eonasdan/bootstrap-datetimepicker/commit/557b657

opw-1825640
closes #24200
This commit is contained in:
Nicolas Lempereur
2018-04-13 09:33:24 +02:00
parent 3ac4b1ab51
commit 7a1db7e620
@@ -391,18 +391,14 @@ THE SOFTWARE.
if (picker.options.calendarWeeks === true) {
html.append('<th class="cw">#</th>');
}
if (moment().localeData()._week.dow === 0) { // starts on Sunday
for (i = 0; i < 7; i++) {
html.append('<th class="dow">' + weekdaysMin[i] + '</th>');
}
} else {
for (i = 1; i < 8; i++) {
if (i === 7) {
html.append('<th class="dow">' + weekdaysMin[0] + '</th>');
} else {
html.append('<th class="dow">' + weekdaysMin[i] + '</th>');
}
}
// ODOO change so week starting not on sunday/monday have correct
// day name. This is solved in saas-15 by using new library version
var startDay = moment().localeData()._week.dow;
if (startDay === undefined) {
startDay = 1;
}
for (i = startDay; i < startDay + 7; i++) {
html.append('<th class="dow">' + weekdaysMin[i % 7] + '</th>');
}
picker.widget.find('.datepicker-days thead').append(html);
},