From: Jordan Augé Date: Thu, 10 Jul 2014 21:05:26 +0000 (+0200) Subject: updated scheduler X-Git-Tag: myslice-1.0~66 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=b666b8f4215c5823cbf86f9a3bc31e7294b1f486;p=myslice.git updated scheduler --- diff --git a/plugins/scheduler2/static/js/scheduler2.js b/plugins/scheduler2/static/js/scheduler2.js index 0b5339fe..59ef6e69 100755 --- a/plugins/scheduler2/static/js/scheduler2.js +++ b/plugins/scheduler2/static/js/scheduler2.js @@ -605,10 +605,13 @@ var SCHEDULER_COLWIDTH = 50; var day_timestamp = SchedulerDateSelected.getTime() / 1000; var id_start = (lease.start_time - day_timestamp) / resource.granularity; - if (id_start < 0) { - /* Some leases might be in the past */ + + /* Some leases might be in the past */ + if (id_start < 0) id_start = 0; - } + /* Leases in the future: ignore */ + if (id_start >= self._all_slots.length) + return true; // ~ continue var id_end = (lease.end_time - day_timestamp) / resource.granularity - 1; var colspan_lease = resource.granularity / self._granularity; //eg. 3600 / 1800 => 2 cells