(js) Handle DST change in Date.daysUpTo

pull/259/head
Francis Lachapelle 2019-10-07 15:58:09 -04:00
parent 2fb81310e3
commit d20587dab0
2 changed files with 7 additions and 3 deletions

View File

@ -283,7 +283,11 @@ Date.prototype.daysUpTo = function(otherDate) {
var nbrDays = Math.round((day2 - day1) / DAY_SECS) + 1;
for (var i = 0; i < nbrDays; i++) {
var newDate = new Date();
newDate.setTime(day1 + (i * 86400000));
newDate.setTime(day1 + (i * DAY_SECS));
newDate.setHours(0);
newDate.setMinutes(0);
newDate.setSeconds(0);
newDate.setMilliseconds(0);
days.push(newDate);
}

View File

@ -329,8 +329,8 @@
if (!vm.attendeesEditor.containerElement) {
vm.attendeesEditor.containerElement = $element[0].querySelector('#freebusy');
}
if (vm.attendeesEditor.containerElement) {
dayElement = $element[0].querySelector('#freebusy_day_' + vm.component.start.getDayString());
dayElement = $element[0].querySelector('#freebusy_day_' + vm.component.start.getDayString());
if (vm.attendeesEditor.containerElement && dayElement) {
scrollLeft = dayElement.offsetLeft - vm.attendeesEditor.containerElement.offsetLeft;
vm.attendeesEditor.containerElement.scrollLeft = scrollLeft;
}