diff options
Diffstat (limited to 'perllib/FixMyStreet/DB/Result')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Alert.pm | 20 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Questionnaire.pm | 20 |
2 files changed, 39 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Alert.pm b/perllib/FixMyStreet/DB/Result/Alert.pm index 53cb96ff4..3a2dc9a9f 100644 --- a/perllib/FixMyStreet/DB/Result/Alert.pm +++ b/perllib/FixMyStreet/DB/Result/Alert.pm @@ -69,11 +69,31 @@ __PACKAGE__->has_many( # You can replace this text with custom code or comments, and it will be preserved on regeneration +use DateTime::TimeZone; use Moose; use namespace::clean -except => [ 'meta' ]; with 'FixMyStreet::Roles::Abuser'; +my $tz = DateTime::TimeZone->new( name => "local" ); + + +sub whensubscribed_local { + my $self = shift; + + return $self->whensubscribed + ? $self->whensubscribed->set_time_zone($tz) + : $self->whensubscribed; +} + +sub whendisabled_local { + my $self = shift; + + return $self->whendisabled + ? $self->whendisabled->set_time_zone($tz) + : $self->whendisabled; +} + =head2 confirm $alert->confirm(); diff --git a/perllib/FixMyStreet/DB/Result/Questionnaire.pm b/perllib/FixMyStreet/DB/Result/Questionnaire.pm index a36c07535..5a507645f 100644 --- a/perllib/FixMyStreet/DB/Result/Questionnaire.pm +++ b/perllib/FixMyStreet/DB/Result/Questionnaire.pm @@ -43,6 +43,24 @@ __PACKAGE__->belongs_to( # Created by DBIx::Class::Schema::Loader v0.07010 @ 2011-05-24 15:32:43 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BAWTYKAQ84VeOI6D2gtQOQ +use DateTime::TimeZone; + +my $tz = DateTime::TimeZone->new( name => "local" ); + +sub whensent_local { + my $self = shift; + + return $self->whensent + ? $self->whensent->set_time_zone($tz) + : $self->whensent; +} + +sub whenanswered_local { + my $self = shift; + + return $self->whenanswered + ? $self->whenanswered->set_time_zone($tz) + : $self->whenanswered; +} -# You can replace this text with custom code or comments, and it will be preserved on regeneration 1; |