thekingsimo / jquery-week-calendar

Automatically exported from code.google.com/p/jquery-week-calendar
0 stars 0 forks source link

Allow timeslotsPerHour to be <1 #109

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I would like to have timeslots of >1 hour. This is currently not possible.

Original issue reported on code.google.com by koosvdk...@gmail.com on 10 Dec 2009 at 8:10

GoogleCodeExporter commented 8 years ago
Suggested fix: 

replace

for (var i = start; i < end; i++) {
  for (var j = 0; j < options.timeslotsPerHour - 1; j++) {
    calendarBodyHtml += "<div class=\"wc-time-slot\"></div>";
  }
  calendarBodyHtml += "<div class=\"wc-time-slot wc-hour-end\"></div>";
}

with

var iStep = options.timeslotsPerHour<1 ? 1/options.timeslotsPerHour : 1;
var jStep = options.timeslotsPerHour<1 ? options.timeslotsPerHour : 1;
for (var i = start; i < end; i=i+iStep) {
  for (var j = 0; j < options.timeslotsPerHour - 1; j=j+jStep) {
    calendarBodyHtml += "<div class=\"wc-time-slot\"></div>";
  }
  calendarBodyHtml += "<div class=\"wc-time-slot wc-hour-end\"></div>";
}

in jquery.weekcalendar.js

Original comment by koosvdk...@gmail.com on 10 Dec 2009 at 8:23