Skip to content
Extraits de code Groupes Projets
Valider 4185d782 rédigé par Rémi - Le Filament's avatar Rémi - Le Filament
Parcourir les fichiers

[FIX] date errors

parent e0aabf07
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -47,10 +47,14 @@ odoo.define("oacc_portal_overview_cdc.operation_chart", function (require) {
this.chartData = null;
},
/**
* @override
*/
willStart: function () {
willStart: async function () {
await loadJS("/web/static/lib/Chart/Chart.js");
await loadJS(
"/oacc_portal_overview_cdc/static/src/js/lib/chartjs-plugin-datalabels.min.js"
);
await loadJS(
"/oacc_portal_overview_cdc/static/lib/daterangepicker/daterangepicker.js"
);
var self = this;
var def = this._rpc({
model: "acc.operation",
......@@ -60,17 +64,6 @@ odoo.define("oacc_portal_overview_cdc.operation_chart", function (require) {
self.minDate = data.date_min;
self.maxDate = data.date_max;
});
return Promise.all([this._super.apply(this, arguments), def]);
},
willStart: async function () {
await loadJS("/web/static/lib/Chart/Chart.js");
await loadJS(
"/oacc_portal_overview_cdc/static/src/js/lib/chartjs-plugin-datalabels.min.js"
);
await loadJS(
"/oacc_portal_overview_cdc/static/lib/daterangepicker/daterangepicker.js"
);
},
/**
......@@ -682,16 +675,16 @@ odoo.define("oacc_portal_overview_cdc.operation_chart", function (require) {
// Disable buttons if first or last date
if (
moment(this.last_day, "dd/mm/yyyy") >=
moment(this.maxDate, "dd/mm/yyyy")
moment(this.last_day, "DD/MM/YYYY") >=
moment(this.maxDate, "DD/MM/YYYY")
) {
$('button[id="next-period"]').prop("disabled", true);
} else {
$('button[id="next-period"]').prop("disabled", false);
}
if (
moment(this.first_day, "dd/mm/yyyy") <=
moment(this.minDate, "dd/mm/yyyy")
moment(this.first_day, "DD/MM/YYYY") <=
moment(this.minDate, "DD/MM/YYYY")
) {
$('button[id="previous-period"]').prop("disabled", true);
} else {
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter