X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plugins%2Fscheduler2%2Fstatic%2Fjs%2Fscheduler2.js;h=102c456f7f4c9da9e37e089d4b559cf7606d9492;hb=da802474c09d93a1c684bd82bdfa163a0cd88b59;hp=0150830ab60020e74a1c8bf7991d5138d78b2fcd;hpb=7254a83bc514a64c05059067bacfe13efaf6284f;p=unfold.git diff --git a/plugins/scheduler2/static/js/scheduler2.js b/plugins/scheduler2/static/js/scheduler2.js index 0150830a..102c456f 100755 --- a/plugins/scheduler2/static/js/scheduler2.js +++ b/plugins/scheduler2/static/js/scheduler2.js @@ -682,7 +682,7 @@ var SCHEDULER_COLWIDTH = 50; resource = this.scope_resources_by_key[lease.resource]; day_timestamp = SchedulerDateSelected.getTime() / 1000; - id_start = (lease.start_time - day_timestamp) / resource.granularity; + id_start = Math.floor((lease.start_time - day_timestamp) / resource.granularity); /* Some leases might be in the past */ if (id_start < 0) @@ -691,14 +691,14 @@ var SCHEDULER_COLWIDTH = 50; if (id_start >= this._all_slots.length) return true; // ~ continue - id_end = (lease.end_time - day_timestamp) / resource.granularity - 1; + id_end = Math.ceil((lease.end_time - day_timestamp) / resource.granularity); colspan_lease = resource.granularity / this._granularity; //eg. 3600 / 1800 => 2 cells if (id_end >= this._all_slots.length / colspan_lease) { /* Limit the display to the current day */ id_end = this._all_slots.length / colspan_lease } - for (i = id_start; i <= id_end; i++) { + for (i = id_start; i < id_end; i++) { // the same slots might be affected multiple times. // PENDING_IN + PENDING_OUT => IN //