X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plugins%2Fscheduler2%2Fstatic%2Fjs%2Fscheduler-helpers.js;h=7275b7556948109a825932d67bdea23126779237;hb=6eb1d8c9d03d2b10b514c317b6fff11172097346;hp=1daeee00c5cc80f7dde46b72ac489e013df2305a;hpb=6e24f5c8289f13a60d28a86543e8a84db63f4426;p=unfold.git diff --git a/plugins/scheduler2/static/js/scheduler-helpers.js b/plugins/scheduler2/static/js/scheduler-helpers.js index 1daeee00..7275b755 100755 --- a/plugins/scheduler2/static/js/scheduler-helpers.js +++ b/plugins/scheduler2/static/js/scheduler-helpers.js @@ -46,20 +46,6 @@ function schedulerCloneArray(originalArray) { return clonedArray; } -function schedulerGetSlots(slotSpan) { - if (slotSpan == 0) slotSpan = 10; - var slots = []; - var d = new Date(2014, 1, 1, 0, 0, 0, 0); - var i = 0; - while (d.getDate() == 1) { - var tmpTime = schedulerPadStr(d.getHours()) + ':' + schedulerPadStr(d.getMinutes()); - slots.push({ id: i, time: tmpTime }); - d = schedulerAddMinutes(d, slotSpan); - i++; - } - return slots; -} - function schedulerGetLeases(slotSpan, granularity) { granularity = granularity / 60; if (slotSpan == 0) slotSpan = 10; @@ -187,7 +173,16 @@ function schedulerAddMinutes(date, minutes) { return new Date(date.getTime() + minutes * 60000); } -function schedulerCompareOnDay(dateOne, dateTwo) { +/** + * Compares two dates + * + * Returns: + * 0 if they are equal + * -1 if the first is less than the second + * 1 if the first is more than the second + */ +function schedulerCompareOnDay(dateOne, dateTwo) +{ if (dateOne.getYear() == dateTwo.getYear() && dateOne.getMonth() == dateTwo.getMonth() && dateOne.getDate() == dateTwo.getDate()) {