From b666b8f4215c5823cbf86f9a3bc31e7294b1f486 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Jordan=20Aug=C3=A9?= <jordan.auge@lip6.fr>
Date: Thu, 10 Jul 2014 23:05:26 +0200
Subject: [PATCH] updated scheduler

---
 plugins/scheduler2/static/js/scheduler2.js | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

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
-- 
2.47.0