From 995c6d38b4df2063b449996e91aebb12fc5d0081 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 22 Mar 2016 15:09:39 +0000 Subject: [PATCH] Highlight working hours --- calendar/js/et2_widget_timegrid.js | 11 ++++++----- calendar/templates/default/app.css | 4 ++++ calendar/templates/pixelegg/app.css | 3 +++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/calendar/js/et2_widget_timegrid.js b/calendar/js/et2_widget_timegrid.js index 30bb8b1165..be1592d532 100644 --- a/calendar/js/et2_widget_timegrid.js +++ b/calendar/js/et2_widget_timegrid.js @@ -703,7 +703,12 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view. this._top_time = 0; for(var t = 0,i = 0; t < 1440; t += granularity,++i) { - html += '
'; + if(t <= wd_start && t + granularity > wd_start) + { + this._top_time = this.rowHeight * (i+1+(wd_start - (t+granularity))/granularity); + } + var working_hours = (t >= wd_start && t < wd_end) ? ' calendar_calWorkHours' : ''; + html += '
'; // show time for full hours, always for 45min interval and at least on every 3 row var time = jQuery.datepicker.formatTime( egw.preference("timeformat") === "12" ? "h:mmtt" : "HH:mm", @@ -715,10 +720,6 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view. }, {"ampm": (egw.preference("timeformat") === "12")} ); - if(t <= wd_start && t + granularity > wd_start) - { - this._top_time = this.rowHeight * (i+1+(wd_start - (t+granularity))/granularity); - } var time_label = (typeof show[granularity] === 'undefined' ? t % 60 === 0 : show[granularity].indexOf(t % 60) !== -1) ? time : ''; if(time_label && egw.preference("timeformat") == "12" && time_label.split(':')[0] < 10) diff --git a/calendar/templates/default/app.css b/calendar/templates/default/app.css index bec9c859cf..1138f12fd6 100644 --- a/calendar/templates/default/app.css +++ b/calendar/templates/default/app.css @@ -276,6 +276,10 @@ Hide subsequent headers in week view with non-consolidated owners * top: */ } +.calendar_calTimeRow:not(.calendar_calWorkHours) +{ + background-color: rgba(120,120,120,0.1); +} /* time in a timeRow */ diff --git a/calendar/templates/pixelegg/app.css b/calendar/templates/pixelegg/app.css index b71bd3841d..01343e92b6 100755 --- a/calendar/templates/pixelegg/app.css +++ b/calendar/templates/pixelegg/app.css @@ -286,6 +286,9 @@ Hide subsequent headers in week view with non-consolidated owners * top: */ } +.calendar_calTimeRow:not(.calendar_calWorkHours) { + background-color: rgba(120, 120, 120, 0.1); +} /* time in a timeRow */ .calendar_calTimeRowTime {