From fe838d2ad3bc5ceee2c368bc6dd55b2e5c680298 Mon Sep 17 00:00:00 2001 From: nathangray Date: Thu, 8 Sep 2016 08:50:26 -0600 Subject: [PATCH] Fix incorrect tooltip in planner if event did not start or end on the hour --- calendar/js/et2_widget_daycol.js | 4 ++-- calendar/js/et2_widget_planner_row.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/calendar/js/et2_widget_daycol.js b/calendar/js/et2_widget_daycol.js index 4bcb02ab3e..59f7d80997 100644 --- a/calendar/js/et2_widget_daycol.js +++ b/calendar/js/et2_widget_daycol.js @@ -885,13 +885,13 @@ var et2_calendar_daycol = (function(){ "use strict"; return et2_valueWidget.exte { event.end = new Date(event.end); } - event['start_m'] = parseInt((event.start.valueOf()/1000 - day_start) / 60); + event['start_m'] = event.start.getUTCHours() * 60 + event.start.getUTCMinutes(); if (event['start_m'] < 0) { event['start_m'] = 0; event['multiday'] = true; } - event['end_m'] = parseInt((event.end.valueOf()/1000 - day_start) / 60); + event['end_m'] = event.end.getUTCHours() * 60 + event.end.getUTCMinutes(); if (event['end_m'] >= 24*60) { event['end_m'] = 24*60-1; diff --git a/calendar/js/et2_widget_planner_row.js b/calendar/js/et2_widget_planner_row.js index 0222e12bd4..915ce37bb2 100644 --- a/calendar/js/et2_widget_planner_row.js +++ b/calendar/js/et2_widget_planner_row.js @@ -576,13 +576,13 @@ var et2_calendar_planner_row = (function(){ "use strict"; return et2_valueWidget day_start -= daylight_diff; } - event['start_m'] = parseInt((event.start.valueOf()/1000 - day_start) / 60); + event['start_m'] = event.start.getUTCHours() * 60 + event.start.getUTCMinutes(); if (event['start_m'] < 0) { event['start_m'] = 0; event['multiday'] = true; } - event['end_m'] = parseInt((event.end.valueOf()/1000 - day_start) / 60); + event['end_m'] = event.end.getUTCHours() * 60 + event.end.getUTCMinutes(); if (event['end_m'] >= 24*60) { event['end_m'] = 24*60-1;