diff options
author | Jonas Smedegaard <dr@jones.dk> | 2024-08-31 12:24:59 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2024-09-01 09:18:49 +0200 |
commit | 0f9cda3eb8afd89a9a2470d9a4c19a5c1c69b092 (patch) | |
tree | b1526d09e39a1d12fbd7b25bd0483f458a51fe05 /lib/Object/Groupware/Calendar.pm | |
parent | 30e1a34d6f69f514c6c1c908c0f77a651074a175 (diff) |
streamline locale and timezone handling
Diffstat (limited to 'lib/Object/Groupware/Calendar.pm')
-rw-r--r-- | lib/Object/Groupware/Calendar.pm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/Object/Groupware/Calendar.pm b/lib/Object/Groupware/Calendar.pm index 7226782..386a749 100644 --- a/lib/Object/Groupware/Calendar.pm +++ b/lib/Object/Groupware/Calendar.pm @@ -3,7 +3,7 @@ use Feature::Compat::Class 0.07; package Object::Groupware::Calendar 0.01; -class Object::Groupware::Calendar; +class Object::Groupware::Calendar : isa(Object::Groupware); use utf8; @@ -39,7 +39,15 @@ method events ( $set = undef, $period = undef ) $set->start, $set->end ) if $set; - my @events = map { Object::Groupware::Event->new( entry => $_ ) } sort { + my $dt_locale = $self->dt_locale; + my $dt_time_zone = $self->dt_time_zone; + my @events = map { + Object::Groupware::Event->new( + entry => $_, + dt_locale => $dt_locale, + dt_time_zone => $dt_time_zone, + ) + } sort { $a->start->compare( $b->start ) || $a->start->compare( $b->start ) || $a->summary cmp $b->summary |