Fix all-day events covering a timezone change

This commit is contained in:
Francis Lachapelle
2015-11-03 15:47:30 -05:00
parent e5c71a4179
commit cbf9b6da3e
5 changed files with 53 additions and 39 deletions
+9
View File
@@ -184,6 +184,15 @@ Date.prototype.daysUpTo = function(otherDate) {
return days;
};
Date.prototype.minutesTo = function(otherDate) {
var delta, dstOffset;
delta = Math.floor(otherDate.valueOf() - this.valueOf())/1000/60;
dstOffset = otherDate.getTimezoneOffset() - this.getTimezoneOffset();
return delta - dstOffset;
};
Date.prototype.stringWithSeparator = function(separator) {
var month = '' + (this.getMonth() + 1);
var day = '' + this.getDate();