[FIX] web: fix chineese calendar format

Issue:
The way we generate the dayNamesMin is not compatible with the chineese
translation provided by "moment.js".
This is because the dayNamesShort contains an extra character in front
週 (week). Because of that the names of the days on the
small calendar are all the character 週 (week).

Solution:
There is a variable (weekdaysMin) which is unused and contain a shorter
version of the days this variable is consitent in the other languages so
it should have no side effect and will fix the chinese translation as it
only contains one character.

Introduced by: 1fc33a63be

task-2692910

closes odoo/odoo#80448

X-original-commit: 7cc502a6eb61bc541dbc27beefed004fcf81e04b
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: fja-odoo <fja@odoo.com>
This commit is contained in:
fja-odoo
2021-11-26 14:26:35 +00:00
parent fdd30e368c
commit 80fec8b5ff
2 changed files with 2 additions and 1 deletions
@@ -477,6 +477,7 @@ return AbstractModel.extend({
monthNamesShort: moment.monthsShort(),
dayNames: moment.weekdays(),
dayNamesShort: moment.weekdaysShort(),
dayNamesMin: moment.weekdaysMin(),
firstDay: this.week_start,
slotLabelFormat: _t.database.parameters.time_format.search("%H") !== -1 ? format24Hour : format12Hour,
allDaySlot: this.mapping.all_day || this.fields[this.mapping.date_start].type === 'date',
@@ -639,7 +639,7 @@ return AbstractRenderer.extend({
});
},
'showOtherMonths': true,
'dayNamesMin' : this.state.fc_options.dayNamesShort.map(x => x[0]),
'dayNamesMin': this.state.fc_options.dayNamesMin.map(x => x[0]),
'monthNames': this.state.fc_options.monthNamesShort,
'firstDay': this.state.fc_options.firstDay,
});