themouette / jquery-week-calendar

A weekly calendar plugin based on jquery and jquery-ui
http://groups.google.com/group/jquery-week-calendar
720 stars 253 forks source link

Y axis displayed times #116

Open thorst opened 12 years ago

thorst commented 12 years ago

From: http://groups.google.com/group/jquery-week-calendar/browse_thread/thread/8bf558926517e246 and http://groups.google.com/group/jquery-week-calendar/browse_thread/thread/3f6cbf80b185c0df

I personally would like to be able to add 30 minute intervals in addition to hourly intervals. 12:00a 12:30a 01:00a 01:30a ...

After i posted my question in the Google groups another user suggested maybe an array of labels for the slots. I think his would be harder since not only are they not a similar design to whats there, they aren't consistent:

07:30 08:20 09:20 10:10 11:10 12:00

Either way i think both features could be valuable additions. I did some research and it looks like the times are generated in _renderCalendarBodyEvents specifically

for (var i = start; i < end; i++) {
  var bhClass = (options.businessHours.start <= i && options.businessHours.end > i) ? 'ui-state-active wc-business-hours' : 'ui-state-default';
  renderRow += '<div class=\"wc-hour-header ' + bhClass + '\">';
  if (options.use24Hour) {
    renderRow += '<div class=\"wc-time-header-cell\">' + self._24HourForIndex(i) + '</div>';
  }
  else {
    renderRow += '<div class=\"wc-time-header-cell\">' + self._hourForIndex(i) + '<span class=\"wc-am-pm\">' + self._amOrPm(i) + '</span></div>';
  }
  renderRow += '</div>';
}

Any help on getting (my request specifically) implemented would be appreciated. Todd

thorst commented 12 years ago

I hacked the fix for mine. At around line 1000 i now have. This would be in place of the else, in my previous post. Obvious issues are that its not dynamic height, It would only work for me (and not the other fellows request),

renderRow += '<div class=\"wc-time-header-cell\">' + self._hourForIndex(i) + ':00<span class=\"wc-am-pm\">' + self._amOrPm(i) + '</span><div style="margin-top:40px;">'+ self._hourForIndex(i) + ':30<span class=\"wc-am-pm\">' + self._amOrPm(i) + '</span></div></div>';