diff --git a/calendar/inc/class.calendar_hooks.inc.php b/calendar/inc/class.calendar_hooks.inc.php index cb0c68896d..6100ba9571 100644 --- a/calendar/inc/class.calendar_hooks.inc.php +++ b/calendar/inc/class.calendar_hooks.inc.php @@ -162,7 +162,7 @@ class calendar_hooks $times[$i] = $GLOBALS['egw']->common->formattime($i,'00'); } - for ($i = 2; $i <= 3; ++$i) + for ($i = 2; $i <= 4; ++$i) { $muliple_weeks[$i.' weeks'] = lang('%1 weeks',$i); } diff --git a/calendar/js/et2_widget_timegrid.js b/calendar/js/et2_widget_timegrid.js index 15d657de2f..125f1813ac 100644 --- a/calendar/js/et2_widget_timegrid.js +++ b/calendar/js/et2_widget_timegrid.js @@ -584,6 +584,13 @@ var et2_calendar_timegrid = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResiz // Pixels this.rowHeight = this.scrolling.height() / rowsToDisplay; + // We need a reasonable bottom limit here... + if(this.rowHeight < 5) + { + this.options.granularity *= 2; + return this._drawTimes(); + } + // the hour rows var show = { 5 : [0,15,30,45], @@ -592,6 +599,7 @@ var et2_calendar_timegrid = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResiz 45 : [0,15,30,45] }; var html = ''; + var line_height = parseInt(this.div.css('line-height')); this._top_time = 0 for(var t = 0,i = 0; t < 1440; t += granularity,++i) { @@ -613,6 +621,11 @@ var et2_calendar_timegrid = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResiz } var time_label = (typeof show[granularity] === 'undefined' ? t % 60 === 0 : show[granularity].indexOf(t % 60) !== -1) ? time : ''; + if(this.rowHeight < line_height) + { + // Rows too small for regular label frequency, use automatic calculation + time_label = ( i % Math.ceil(line_height / this.rowHeight) ) === 0 ? time : ''; + } html += '
'+time_label+"
\n"; } diff --git a/calendar/templates/default/app.css b/calendar/templates/default/app.css index b89d098063..e001253fdc 100644 --- a/calendar/templates/default/app.css +++ b/calendar/templates/default/app.css @@ -238,7 +238,7 @@ e.g. the div with class calendar_calTimeGrid is generated by the timeGridWidget vertical-align: top; border-right: 1px solid silver; height: initial; - min-height: 4em; + min-height: 2em; /* Nice transition when changing days in a week */ transition: width 1s ease-in-out; z-index:30; @@ -367,7 +367,7 @@ e.g. the div with class calendar_calTimeGrid is generated by the timeGridWidget padding-left: 3px; z-index: 29; border-bottom: 1px solid silver; - min-height: 45px; + min-height: 2ex; flex: 0 0 auto; } #calendar-view_view tbody.ui-sortable {