[fix] Issues with freebusy in attendees editor

This commit is contained in:
Francis Lachapelle
2015-03-31 15:19:53 -04:00
parent 94d546dc7a
commit ab121e6c15
3 changed files with 15 additions and 7 deletions
@@ -130,7 +130,7 @@ Date.prototype.deltaDays = function(otherDate) {
day1 = tmp;
}
return Math.floor((day2 - day1) / 86400000);
return Math.round((day2 - day1) / 86400000);
}
Date.prototype.daysUpTo = function(otherDate) {
@@ -152,7 +152,7 @@ Date.prototype.daysUpTo = function(otherDate) {
// var day1 = day1Date.getTime();
// var day2 = day2Date.getTime();
var nbrDays = Math.floor((day2 - day1) / 86400000) + 1;
var nbrDays = Math.round((day2 - day1) / 86400000) + 1;
for (var i = 0; i < nbrDays; i++) {
var newDate = new Date();
newDate.setTime(day1 + (i * 86400000));
@@ -217,9 +217,8 @@ Date.prototype.stringWithSeparator = function(separator) {
};
Date.prototype.addDays = function(nbrDays) {
var milliSeconds = this.getTime();
milliSeconds += 86400000 * Math.round(nbrDays);
this.setTime(milliSeconds);
var dat = new Date(this.valueOf());
this.setDate(dat.getDate() + Math.round(nbrDays));
};
Date.prototype.earlierDate = function(otherDate) {