aboutsummaryrefslogtreecommitdiff
path: root/lib/Object/Groupware.pm
blob: 74752639304b99a6663ef81b7d050b0fc9eeb934 (plain)
  1. use v5.36;
  2. #use Feature::Compat::Class 0.07;
  3. use Object::Pad 0.78 qw(:experimental(custom_field_attr));
  4. package Object::Groupware 0.01;
  5. class Object::Groupware;
  6. use utf8;
  7. use Log::Any qw( );
  8. field $log = Log::Any->get_logger;
  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. if ( defined $self->dt_locale
  14. and not $self->dt_locale isa DateTime::Locale::FromData )
  15. {
  16. $dt_locale = DateTime::Locale->load( $self->dt_locale );
  17. $log->debugf(
  18. 'Coerced object %s locale: %s (%s)',
  19. __CLASS__, $self->dt_locale->code, $self->dt_locale->name
  20. );
  21. }
  22. if ( defined $self->dt_time_zone
  23. and not $self->dt_time_zone isa DateTime::TimeZone )
  24. {
  25. $dt_time_zone
  26. = DateTime::TimeZone->new( name => $self->dt_time_zone );
  27. $log->debugf(
  28. 'Coerced object %s time zone: %s',
  29. __CLASS__, $self->dt_time_zone->name
  30. );
  31. }
  32. }
  33. 1;