diff options
Diffstat (limited to 'lib/Object/Groupware.pm')
-rw-r--r-- | lib/Object/Groupware.pm | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/lib/Object/Groupware.pm b/lib/Object/Groupware.pm new file mode 100644 index 0000000..083f415 --- /dev/null +++ b/lib/Object/Groupware.pm @@ -0,0 +1,37 @@ +use v5.36; +use Feature::Compat::Class 0.07; + +package Object::Groupware 0.01; + +class Object::Groupware; + +use utf8; + +use Log::Any qw( ); + +field $log = Log::Any->get_logger; + +field $dt_locale : param : reader = undef; +field $dt_time_zone : param : reader = undef; +field $dt_span_time_prefix : param : reader = ''; + +ADJUST { + if ( defined $self->dt_locale ) { + $dt_locale = DateTime::Locale->load( $self->dt_locale ) + unless $self->dt_locale isa DateTime::Locale::FromData; + $log->debugf( + 'Class %s set up to use locale %s (%s)', + __CLASS__, $self->dt_locale->code, $self->dt_locale->name + ); + } + if ( defined $self->dt_time_zone ) { + $dt_time_zone = DateTime::TimeZone->new( name => $self->dt_time_zone ) + unless $self->dt_time_zone isa DateTime::TimeZone; + $log->debugf( + 'Class %s set up to use time zone %s', + __CLASS__, $self->dt_time_zone->name + ); + } +} + +1; |