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