* Calendar - add birthday icon to planner for time scales less than a month

This commit is contained in:
nathangray 2018-07-24 16:20:50 -06:00
parent 85d592c5ee
commit 58490c24b7
3 changed files with 10 additions and 5 deletions

View File

@ -1149,6 +1149,8 @@ var et2_calendar_planner = (function(){ "use strict"; return et2_calendar_view.e
tempDate.setMinutes(tempDate.getMinutes()-tempDate.getTimezoneOffset()); tempDate.setMinutes(tempDate.getMinutes()-tempDate.getTimezoneOffset());
var title = ''; var title = '';
var state = ''; var state = '';
state = new Date(t.valueOf() - t.getTimezoneOffset() * 60 * 1000);
var day_class = this.day_class_holiday(state,holidays, days);
if (days <= 3) if (days <= 3)
{ {
@ -1162,8 +1164,6 @@ var et2_calendar_planner = (function(){ "use strict"; return et2_calendar_view.e
{ {
title = this.egw().lang(date('D',t)).substr(0,2)+'<br />'+date('j',t); title = this.egw().lang(date('D',t)).substr(0,2)+'<br />'+date('j',t);
} }
state = new Date(t.valueOf() - t.getTimezoneOffset() * 60 * 1000);
var day_class = this.day_class_holiday(state,holidays);
content += '<div class="calendar_plannerDayScale et2_clickable et2_link '+ day_class+ content += '<div class="calendar_plannerDayScale et2_clickable et2_link '+ day_class+
'" data-date=\'' + state.toJSON() +'\''+ '" data-date=\'' + state.toJSON() +'\''+
@ -1224,10 +1224,11 @@ var et2_calendar_planner = (function(){ "use strict"; return et2_calendar_view.e
* *
* @param {Date} date * @param {Date} date
* @param {string[]} holiday_list Filled with a list of holidays for that day * @param {string[]} holiday_list Filled with a list of holidays for that day
* @param {integer} days Number of days shown in the day header
* *
* @return {string} CSS Classes for the day. calendar_calBirthday, calendar_calHoliday, calendar_calToday and calendar_weekend as appropriate * @return {string} CSS Classes for the day. calendar_calBirthday, calendar_calHoliday, calendar_calToday and calendar_weekend as appropriate
*/ */
day_class_holiday: function(date,holiday_list) { day_class_holiday: function(date,holiday_list, days) {
if(!date) return ''; if(!date) return '';
@ -1247,6 +1248,10 @@ var et2_calendar_planner = (function(){ "use strict"; return et2_calendar_view.e
if (typeof holidays[i]['birthyear'] !== 'undefined') if (typeof holidays[i]['birthyear'] !== 'undefined')
{ {
day_class += ' calendar_calBirthday '; day_class += ' calendar_calBirthday ';
if(typeof days == 'undefined' || days <= 21)
{
day_class += ' calendar_calBirthdayIcon ';
}
holiday_list.push(holidays[i]['name']); holiday_list.push(holidays[i]['name']);
} }

View File

@ -270,7 +270,7 @@ e.g. the div with class calendar_calTimeGrid is generated by the timeGridWidget
.calendar_calBirthday,.calendar_calBirthday a{ .calendar_calBirthday,.calendar_calBirthday a{
color: #626161; color: #626161;
} }
#calendar-view .calendar_calBirthday { #calendar-view .calendar_calBirthday, #calendar-planner .calendar_plannerHeader .calendar_calBirthdayIcon {
background-image: url(images/cake.png); background-image: url(images/cake.png);
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 16px; background-size: 16px;

View File

@ -276,7 +276,7 @@ e.g. the div with class calendar_calTimeGrid is generated by the timeGridWidget
.calendar_calBirthday a { .calendar_calBirthday a {
color: #626161; color: #626161;
} }
#calendar-view .calendar_calBirthday { #calendar-view .calendar_calBirthday, #calendar-planner .calendar_plannerHeader .calendar_calBirthdayIcon {
background-image: url(images/cake.png); background-image: url(images/cake.png);
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 16px; background-size: 16px;