[FIX] web: control panel date filter ok in arabic
The date filters sent to servers were being computed in current locale, so in arabic we would get things like this: - "٢٠١٩-١٢-٠٩" instead of "2019-12-09" - "٢٠١٩-١٢-٠٩ ١٦:١٦:١٥" instead of "2019-12-09 16:16:15" which would cause a traceback in backend. opw-2122333 closes #41570 closes odoo/odoo#41596 X-original-commit: da778afc24b048244467649dfa4af4e6f4a78e44 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
This commit is contained in:
@@ -231,8 +231,8 @@ var ControlPanelView = Factory.extend({
|
||||
const setParam = _.extend({}, y.setParam, o ? o.setParam : {});
|
||||
const granularity = o ? o.granularity : y.granularity;
|
||||
const date = this.referenceMoment.clone().set(setParam).add(addParam);
|
||||
let leftBound = date.clone().startOf(granularity);
|
||||
let rightBound = date.clone().endOf(granularity);
|
||||
let leftBound = date.clone().startOf(granularity).locale('en');
|
||||
let rightBound = date.clone().endOf(granularity).locale('en');
|
||||
|
||||
if (filter.fieldType === 'date') {
|
||||
leftBound = leftBound.format("YYYY-MM-DD");
|
||||
|
||||
Reference in New Issue
Block a user