[FIX] web_calendar: date/datetime fields format in calendar views
As everywhere else, dates & datetimes must be formatted according to the format defined in the `res.lang` of the user, and within the timezone of the user. Before this revision, when adding a datetime field to a calendar view, the raw value of the date was displayed, for instance: `2015-01-01 10:00:00` instead of `01/01/2015 11:00:00` for a user in English(US), in UTC +1. fixes #5324 opw-653625
This commit is contained in:
parent
0ea130424d
commit
2f35c40714
|
@ -510,6 +510,9 @@ openerp.web_calendar = function(instance) {
|
||||||
throw new Error("Incomplete data received from dataset for record " + evt.id);
|
throw new Error("Incomplete data received from dataset for record " + evt.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (_.contains(["date", "datetime"], self.fields[fieldname].type)) {
|
||||||
|
temp_ret[fieldname] = instance.web.format_value(value, self.fields[fieldname]);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
temp_ret[fieldname] = value;
|
temp_ret[fieldname] = value;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue