Permalink
Browse files

Fix: the hourline did not consider the start and end business hours

  • Loading branch information...
1 parent 0e06956 commit 8e8b00c870a210662d287d2d48dd5ad05589bfec @K-Phoen K-Phoen committed Apr 29, 2012
Showing with 10 additions and 3 deletions.
  1. +1 −1 jquery.weekcalendar.css
  2. +9 −2 jquery.weekcalendar.js
@@ -268,7 +268,7 @@ table.wc-time-slots {
border-top: 2px solid #FF7F6E;
overflow: hidden;
position: absolute;
- width: 100%;
+ width: inherit;
}
/* IE6 hacks */
@@ -1266,13 +1266,20 @@
*/
_drawCurrentHourLine: function() {
var d = new Date(),
- options = this.options;
+ options = this.options,
+ businessHours = options.businessHours;
// first, we remove the old hourline if it exists
$('.wc-hourline', this.element).remove();
+ // the line does not need to be displayed
+ if (businessHours.limitDisplay && d.getHours() > businessHours.end) {
+ return;
+ }
+
// then we recreate it
- var nbHours = d.getHours() + d.getMinutes() / 60;
+ var paddingStart = businessHours.limitDisplay ? businessHours.start : 0;
+ var nbHours = d.getHours() - paddingStart + d.getMinutes() / 60;
var positionTop = nbHours * options.timeslotHeight * options.timeslotsPerHour;
$('.wc-scrollable-grid .wc-today', this.element).append(

0 comments on commit 8e8b00c

Please sign in to comment.