(fix) correctly round up the start/end/due time to 15 mins

pull/110/head
Ludovic Marcotte 2015-10-07 09:22:26 -04:00
parent 4f4b00cc54
commit 74eb0846e8
1 changed files with 4 additions and 0 deletions

View File

@ -405,12 +405,14 @@
this.start = new Date(this.startDate.substring(0,10) + ' ' + this.startDate.substring(11,16));
else if (this.type == 'appointment') {
this.start = new Date();
this.start.setMinutes(Math.round(this.start.getMinutes()/15)*15);
}
if (this.endDate)
this.end = new Date(this.endDate.substring(0,10) + ' ' + this.endDate.substring(11,16));
else if (this.type == 'appointment') {
this.end = new Date();
this.end.setMinutes(Math.round(this.end.getMinutes()/15)*15);
this.end.addHours(1);
}
@ -806,6 +808,7 @@
*/
Component.prototype.$addDueDate = function() {
this.due = new Date();
this.due.setMinutes(Math.round(this.due.getMinutes()/15)*15);
this.dueDate = this.due.toISOString();
};
@ -826,6 +829,7 @@
*/
Component.prototype.$addStartDate = function() {
this.start = new Date();
this.start.setMinutes(Math.round(this.start.getMinutes()/15)*15);
};
/**