aboutsummaryrefslogtreecommitdiff
path: root/lib/Object/Groupware.pm
blob: eac1bf7e2949f21c049f6a4768c6946bbd35af94 (plain)
  1. use v5.36;
  2. #use Feature::Compat::Class 0.07;
  3. use Object::Pad 0.78;
  4. package Object::Groupware 0.01;
  5. class Object::Groupware;
  6. use utf8;
  7. use Log::Any qw( );
  8. field $log = undef;
  9. field $dt_locale : param : reader = undef;
  10. field $dt_time_zone : param : reader = undef;
  11. field $dt_span_time_prefix : param : reader = '';
  12. ADJUST {
  13. # TODO: use Object::Pad 0.07 and move this to field initializer
  14. $log = Log::Any->get_logger;
  15. if ( defined $self->dt_locale
  16. and not $self->dt_locale isa DateTime::Locale::FromData )
  17. {
  18. $dt_locale = DateTime::Locale->load( $self->dt_locale );
  19. $log->debugf(
  20. 'Coerced object %s locale: %s (%s)',
  21. __CLASS__, $self->dt_locale->code, $self->dt_locale->name
  22. );
  23. }
  24. if ( defined $self->dt_time_zone
  25. and not $self->dt_time_zone isa DateTime::TimeZone )
  26. {
  27. $dt_time_zone
  28. = DateTime::TimeZone->new( name => $self->dt_time_zone );
  29. $log->debugf(
  30. 'Coerced object %s time zone: %s',
  31. __CLASS__, $self->dt_time_zone->name
  32. );
  33. }
  34. }
  35. 1;