Skip Menu |

This queue is for tickets about the RTx-Calendar CPAN distribution.

Report information
The Basics
Id: 74981
Status: open
Priority: 0/
Queue: RTx-Calendar

People
Owner: Nobody in particular
Requestors:
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: suggestions for displaying calendar
hi, Here are some ideas about calendar display. I've tried to write code to show what I want, and I'm glad if you consider to implement some of them in sophisticated way :) 1. Make tickets distinguishable when multiple tickets are displayed on the same day. --- calendar.css.orig 2012-02-13 19:02:20.000000000 +0900 +++ calendar.css 2012-02-13 17:36:36.000000000 +0900 @@ -1,4 +1,4 @@ -.tooltip{position:relative;z-index:1;padding:6px; margin-bottom:6px;border: 1px solid #d7d7d7;} +.tooltip{position:relative;z-index:1; background:#ffffdd; padding:6px; margin-bottom:6px;border: 1px solid #d7d7d7;} .tooltip:hover{z-index:5;color:#000;} .tooltip span.tip{display: none; text-align:left;} 2. Give a display class to td cell of days ... --- Calendar.pm.orig 2012-02-13 19:03:06.000000000 +0900 +++ Calendar.pm 2012-02-13 18:18:23.000000000 +0900 @@ -6,6 +6,17 @@ our $VERSION = "0.10"; +sub DateClass { + my $date = shift; + #@holidays = (qw( 2012-01-01 2012-01-02 ... )); # in siteconfig + #return ' holiday' if $date in @holidays .... + + return ' holiday' if $date->day_of_week() == 7; + return ' saturday' if $date->day_of_week() == 6; + + return ''; +} + sub FirstMonday { my ($year, $month) = (shift, shift); my $set = DateTime::Set->from_recurrence( --- Calendar.html.orig 2012-02-13 15:12:27.000000000 +0900 +++ Calendar.html 2012-02-13 17:33:04.000000000 +0900 @@ -63,7 +63,7 @@ % if ( $date->day_of_week == 1) { <th><% $date->week_number %></th> % } -<td class="<% $date->month != ($Month + 1) ? 'oddline' : '' %>" +<td class="<% $date->month != ($Month + 1) ? 'oddline' : '' %><% RTx::Calendar::DateClass($date) %>" style="width:14%;<% DateTime->compare($today, $date) == 0 ? 'background:#f6f7f8;' : '' %>" Show quoted text
>
<p class="date"><%$date->day%></p> ... and, users can customize their calendar simply with css. --- calendar.css.orig 2012-02-13 19:02:20.000000000 +0900 +++ calendar.css 2012-02-13 17:36:36.000000000 +0900 @@ -27,6 +27,19 @@ table.rtxcalendar td { border: 1px solid #d7d7d7; vertical-align: top; + background:#ffffff; +} + +table.rtxcalendar td.holiday { + background:#ffe4e1; +} + +table.rtxcalendar td.saturday { + background:#ccffff; +} + +table.rtxcalendar td.oddline { + background: #d7d7d7 } table.rtxcalendar th { regards, -- KURASHIKI Satoru
hi, please replace the sample above like: --- Calendar.pm.orig 2012-02-13 19:03:06.000000000 +0900 +++ Calendar.pm 2012-04-05 14:12:40.000000000 +0900 @@ -6,6 +6,18 @@ our $VERSION = "0.10"; +sub DateClass { + my $date = shift; + return ' holiday' if $date->day_of_week() == 7; + return ' saturday' if $date->day_of_week() == 6; + + my %holidays = (); + foreach my $holiday (RT->Config->Get('CalendarHolidays')) { + $holidays{$holiday} = "true"; + } + return (defined $holidays{$date->date}) ? ' holiday' : ''; +} + sub FirstMonday { my ($year, $month) = (shift, shift); my $set = DateTime::Set->from_recurrence( So, we can specify site specific holidays by siteconfig like: Set(@CalendarHolidays, (qw( 2012-01-01 2012-01-02 2012-01-09 2012-02-11 2012-03-20 2012-04-29 2012-04-30 2012-05-03 2012-05-04 2012-05-05 2012-07-16 2012-09-17 2012-09-22 2012-10-08 2012-11-03 2012-11-23 2012-12-23 2012-12-24 2012-12-31 ))); regards, -- KURASHIKI Satoru