summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js/views
diff options
context:
space:
mode:
authorjerome hanke (jhk) <jhk@odoo.com>2020-01-10 09:45:28 +0000
committerjerome hanke (jhk) <jhk@odoo.com>2020-01-13 15:15:06 +0000
commitfca4694d805ebce0c8bcef85738c160dc7e290b7 (patch)
tree9f14956721bf4899a2cb1b779a4e2ae5c295ddc5 /addons/mail/static/src/js/views
parentcd0f9bf943ceaf6e8cf56e233621008dd423859d (diff)
[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>
Diffstat (limited to 'addons/mail/static/src/js/views')
-rw-r--r--addons/mail/static/src/js/views/activity/activity_renderer.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/mail/static/src/js/views/activity/activity_renderer.js b/addons/mail/static/src/js/views/activity/activity_renderer.js
index 480bad864e7..7e106a4418a 100644
--- a/addons/mail/static/src/js/views/activity/activity_renderer.js
+++ b/addons/mail/static/src/js/views/activity/activity_renderer.js
@@ -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' }));