Permalink
Browse files

Fix incorrect day view start date shift

There are a bunch of spots in the view rendering code that get a 12 hour shift applied to avoid daylight savings edge cases. However, the underlying start date of the calendar should not have been shifted. In most cases the view logic was defaulting this start date back to 0, which was hiding the bug, but the day view was simply defaulting to the (incorrect) calendar start date. Removed the 12 hour shift from the start date that should never have been applied in the first place.
  • Loading branch information...
bmoeskau committed Apr 10, 2016
1 parent b943a7d commit 2d91044ee9b2d1360eb45e289b40737524c5ce59
Showing with 6 additions and 5 deletions.
  1. +6 −5 src/calendar/view/AbstractCalendar.js
@@ -1219,9 +1219,10 @@ Ext.define('Extensible.calendar.view.AbstractCalendar', {
var start = this.viewStart.getTime(),
end = this.viewEnd.getTime(),
evStart = data[eventMappings.StartDate.name].getTime(),
evEnd = data[eventMappings.EndDate.name].getTime();
evEnd = data[eventMappings.EndDate.name].getTime(),
isOverlapping = Extensible.Date.rangesOverlap(start, end, evStart, evEnd);
return Extensible.Date.rangesOverlap(start, end, evStart, evEnd);
return isOverlapping;
},
isOverlapping: function(evt1, evt2) {
@@ -1296,7 +1297,7 @@ Ext.define('Extensible.calendar.view.AbstractCalendar', {
setStartDate: function(start, /*private*/reload) {
var me = this;
var startDate = Extensible.Date.add(Ext.Date.clearTime(start || new Date(), true), {hours: 12});
var startDate = Extensible.Date.add(Ext.Date.clearTime(start || new Date(), true));
Extensible.log('setStartDate (base) ' + Ext.Date.format(startDate, 'Y-m-d G:i'));
var cloneDt = Ext.Date.clone,
@@ -1333,8 +1334,8 @@ Ext.define('Extensible.calendar.view.AbstractCalendar', {
switch(this.weekCount) {
case 0:
case 1:
me.viewStart = me.dayCount < 7 && !me.startDayIsStatic ?
start: Extensible.Date.add(start, {days: -offset, clearTime: true});
me.viewStart = me.dayCount < 7 && !me.startDayIsStatic ? start :
Extensible.Date.add(start, {days: -offset, clearTime: true});
me.viewEnd = Extensible.Date.add(me.viewStart, {days: me.dayCount || 7, seconds: -1});
break;

0 comments on commit 2d91044

Please sign in to comment.