[FIX] mail: correct activity due date on activity view
Steps to reproduce: - install crm - set your computer timezone to GMT-6 (Mexico city) - go to crm > change the view to activity view Current behavior: all activities are one day off from their actual deadline (an activity set to be due on the 7th of January shows as 6 Jan on the view) Current behavior: activities are displayed properly according to their due date opw-2162579 closes odoo/odoo#43223 X-original-commit: 0735547086aaab819369b1a08e6810baeac3783d Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
@@ -208,7 +208,10 @@ var ActivityRenderer = AbstractRenderer.extend({
|
||||
var def = widget.appendTo($td).then(function () {
|
||||
// replace clock by closest deadline
|
||||
var $date = $('<div class="o_closest_deadline">');
|
||||
var date = new Date(activity_group.o_closest_deadline);
|
||||
// split the year/month/day to create a date (to have a date, no tz, instead of a datetime, tz dependant)
|
||||
var splitDate = activity_group.o_closest_deadline.split('-');
|
||||
// the value representing the month, ranges from 0 for January up to 11 for December.
|
||||
var date = new Date(splitDate[0], splitDate[1]-1, splitDate[2]);
|
||||
// To remove year only if current year
|
||||
if (moment().year() === moment(date).year()) {
|
||||
$date.text(date.toLocaleDateString(moment().locale(), { day: 'numeric', month: 'short' }));
|
||||
|
||||
Reference in New Issue
Block a user