[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:
Xavier ALT 2015-10-29 12:11:09 +01:00 committed by Denis Ledoux
parent 0ea130424d
commit 2f35c40714
1 changed files with 3 additions and 0 deletions

View File

@ -510,6 +510,9 @@ openerp.web_calendar = function(instance) {
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 {
temp_ret[fieldname] = value;
}