From bb31750e7c28a6bb0a3900582f48865d8cab89b6 Mon Sep 17 00:00:00 2001 From: Martin Kamerbeek Date: Wed, 3 Jun 2009 14:28:11 +0000 Subject: [PATCH] Fixed: Calendar: Weekly re-occurence function not working properly (#10228) --- docs/changelog/7.x.x.txt | 2 ++ lib/WebGUI/Asset/Event.pm | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 983254163..17717a66b 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -17,6 +17,8 @@ - fixed #10365: Head tags do not work "Use Packed Head Tags". - fixed #9927: Survey - verbatim - fixed #10352: Deleting a user does not clean up any address books + - fixed #10228: Calendar: Weekly re-occurence function not working properly + ( Martin Kamerbeek / Oqapi ) 7.7.8 - fixed: Basic Auth doesn't work if password contains colon (Arjan Widlak, diff --git a/lib/WebGUI/Asset/Event.pm b/lib/WebGUI/Asset/Event.pm index ebdb15436..1075fe3cb 100644 --- a/lib/WebGUI/Asset/Event.pm +++ b/lib/WebGUI/Asset/Event.pm @@ -755,13 +755,13 @@ sub getRecurrenceDates { return undef unless $recur->{recurType}; my %dayNames = ( - monday => "m", - tuesday => "t", - wednesday => "w", - thursday => "r", - friday => "f", - saturday => "s", - sunday => "u", + 1 => "m", + 2 => "t", + 3 => "w", + 4 => "r", + 5 => "f", + 6 => "s", + 7 => "u", ); my %weeks = ( @@ -844,7 +844,7 @@ sub getRecurrenceDates { last RECURRENCE if ($recur->{endDate} && $dt_day > $dt_end); - my $today = $dayNames{lc $dt_day->day_name}; + my $today = $dayNames{ $dt_day->day_of_week }; if (grep /$today/i, @{$recur->{dayNames}}) { ### Add date @@ -915,7 +915,7 @@ sub getRecurrenceDates { # If today isn't in the month, stop looking last if ($dt_day->month ne $dt->month); - my $today = $dayNames{lc $dt_day->day_name}; + my $today = $dayNames{ $dt_day->day_of_week }; if (grep /$today/i, @{$recur->{dayNames}}) { @@ -946,7 +946,7 @@ sub getRecurrenceDates { # If today is past the endDate, try the next one next if ($recur->{endDate} && $dt_day > $dt_end); - my $today = $dayNames{lc $dt_day->day_name}; + my $today = $dayNames{ $dt_day->day_of_week }; if (grep /$today/i, @{$recur->{dayNames}}) { ### Add date @@ -1036,7 +1036,7 @@ sub getRecurrenceDates { # If today isn't in the month, stop looking last if ($dt_day->month ne $dt_month->month); - my $today = $dayNames{lc $dt_day->day_name}; + my $today = $dayNames{ lc $dt_day->day_of_week }; if (grep /$today/i, @{$recur->{dayNames}}) { ### Add date @@ -1064,7 +1064,7 @@ sub getRecurrenceDates { next if ($recur->{endDate} && $dt_day > $dt_end); - my $today = $dayNames{lc $dt_day->day_name}; + my $today = $dayNames{ $dt_day->day_of_week }; if (grep /$today/i, @{$recur->{dayNames}}) { ### Add date