blob: eac1bf7e2949f21c049f6a4768c6946bbd35af94 (
plain)
- use v5.36;
- #use Feature::Compat::Class 0.07;
- use Object::Pad 0.78;
- package Object::Groupware 0.01;
- class Object::Groupware;
- use utf8;
- use Log::Any qw( );
- field $log = undef;
- field $dt_locale : param : reader = undef;
- field $dt_time_zone : param : reader = undef;
- field $dt_span_time_prefix : param : reader = '';
- ADJUST {
- # TODO: use Object::Pad 0.07 and move this to field initializer
- $log = Log::Any->get_logger;
- if ( defined $self->dt_locale
- and not $self->dt_locale isa DateTime::Locale::FromData )
- {
- $dt_locale = DateTime::Locale->load( $self->dt_locale );
- $log->debugf(
- 'Coerced object %s locale: %s (%s)',
- __CLASS__, $self->dt_locale->code, $self->dt_locale->name
- );
- }
- if ( defined $self->dt_time_zone
- and not $self->dt_time_zone isa DateTime::TimeZone )
- {
- $dt_time_zone
- = DateTime::TimeZone->new( name => $self->dt_time_zone );
- $log->debugf(
- 'Coerced object %s time zone: %s',
- __CLASS__, $self->dt_time_zone->name
- );
- }
- }
- 1;
|