[FIX] mail: track date change
- Set your timezone in Brasil - Install the Maintenance module - Create a Maintenance Request, set the Requested Date to 2017-06-15 - Save In the chatter, the track fields message shows a Requested Date of 2017-06-14. This can actually happen with any date tracked. The issue comes from the web client: it converts the date in UTC, which should of course not be done. This only applies for a datetime, not for a date. opw-746216
This commit is contained in:
@@ -287,14 +287,22 @@ function make_message (data) {
|
|||||||
// can not be done in preprocess, since it alter the original value
|
// can not be done in preprocess, since it alter the original value
|
||||||
if (msg.tracking_value_ids && msg.tracking_value_ids.length) {
|
if (msg.tracking_value_ids && msg.tracking_value_ids.length) {
|
||||||
_.each(msg.tracking_value_ids, function(f) {
|
_.each(msg.tracking_value_ids, function(f) {
|
||||||
if (_.contains(['date', 'datetime'], f.field_type)) {
|
if (f.field_type === 'datetime') {
|
||||||
var format = (f.field_type === 'date') ? 'LL' : 'LLL';
|
var format = 'LLL';
|
||||||
if (f.old_value) {
|
if (f.old_value) {
|
||||||
f.old_value = moment.utc(f.old_value).local().format(format);
|
f.old_value = moment.utc(f.old_value).local().format(format);
|
||||||
}
|
}
|
||||||
if (f.new_value) {
|
if (f.new_value) {
|
||||||
f.new_value = moment.utc(f.new_value).local().format(format);
|
f.new_value = moment.utc(f.new_value).local().format(format);
|
||||||
}
|
}
|
||||||
|
} else if (f.field_type === 'date') {
|
||||||
|
var format = 'LL';
|
||||||
|
if (f.old_value) {
|
||||||
|
f.old_value = moment(f.old_value).local().format(format);
|
||||||
|
}
|
||||||
|
if (f.new_value) {
|
||||||
|
f.new_value = moment(f.new_value).local().format(format);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user