diff options
author | Matthew Somerville <matthew@mysociety.org> | 2013-02-14 16:15:32 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2013-02-14 16:36:17 +0000 |
commit | 5c88c6954449bb6d2dbc1a6d1142d08adbc89d55 (patch) | |
tree | 8403f80f6d80cb60541ae90a0fe6e1b4ea8d324e /perllib/FixMyStreet/App/Controller | |
parent | f8fef5162bddb4e10f22f8ddce8314a585ec8b4b (diff) |
Remove *_local tz functions, set timezone on fetching original columns from database.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin.pm | 16 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Open311.pm | 6 |
2 files changed, 11 insertions, 11 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index 125293666..bb7ec2381 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -145,34 +145,34 @@ sub timeline : Path( 'timeline' ) : Args(0) { my $probs = $c->cobrand->problems->timeline; foreach ($probs->all) { - push @{$time{$_->created->epoch}}, { type => 'problemCreated', date => $_->created_local, obj => $_ }; - push @{$time{$_->confirmed->epoch}}, { type => 'problemConfirmed', date => $_->confirmed_local, obj => $_ } if $_->confirmed; - push @{$time{$_->whensent->epoch}}, { type => 'problemSent', date => $_->whensent_local, obj => $_ } if $_->whensent; + push @{$time{$_->created->epoch}}, { type => 'problemCreated', date => $_->created, obj => $_ }; + push @{$time{$_->confirmed->epoch}}, { type => 'problemConfirmed', date => $_->confirmed, obj => $_ } if $_->confirmed; + push @{$time{$_->whensent->epoch}}, { type => 'problemSent', date => $_->whensent, obj => $_ } if $_->whensent; } my $questionnaires = $c->model('DB::Questionnaire')->timeline( $c->cobrand->restriction ); foreach ($questionnaires->all) { - push @{$time{$_->whensent->epoch}}, { type => 'quesSent', date => $_->whensent_local, obj => $_ }; - push @{$time{$_->whenanswered->epoch}}, { type => 'quesAnswered', date => $_->whenanswered_local, obj => $_ } if $_->whenanswered; + push @{$time{$_->whensent->epoch}}, { type => 'quesSent', date => $_->whensent, obj => $_ }; + push @{$time{$_->whenanswered->epoch}}, { type => 'quesAnswered', date => $_->whenanswered, obj => $_ } if $_->whenanswered; } my $updates = $c->model('DB::Comment')->timeline( $site_restriction ); foreach ($updates->all) { - push @{$time{$_->created->epoch}}, { type => 'update', date => $_->created_local, obj => $_} ; + push @{$time{$_->created->epoch}}, { type => 'update', date => $_->created, obj => $_} ; } my $alerts = $c->model('DB::Alert')->timeline_created( $c->cobrand->restriction ); foreach ($alerts->all) { - push @{$time{$_->whensubscribed->epoch}}, { type => 'alertSub', date => $_->whensubscribed_local, obj => $_ }; + push @{$time{$_->whensubscribed->epoch}}, { type => 'alertSub', date => $_->whensubscribed, obj => $_ }; } $alerts = $c->model('DB::Alert')->timeline_disabled( $c->cobrand->restriction ); foreach ($alerts->all) { - push @{$time{$_->whendisabled->epoch}}, { type => 'alertDel', date => $_->whendisabled_local, obj => $_ }; + push @{$time{$_->whendisabled->epoch}}, { type => 'alertDel', date => $_->whendisabled, obj => $_ }; } $c->model('DB')->schema->storage->sql_maker->quote_char( '' ); diff --git a/perllib/FixMyStreet/App/Controller/Open311.pm b/perllib/FixMyStreet/App/Controller/Open311.pm index 7b8cb649f..a4e72e9bd 100644 --- a/perllib/FixMyStreet/App/Controller/Open311.pm +++ b/perllib/FixMyStreet/App/Controller/Open311.pm @@ -240,8 +240,8 @@ sub output_requests : Private { 'long' => [ $problem->longitude ], 'status' => [ $problem->state ], # 'status_notes' => [ {} ], - 'requested_datetime' => [ w3date($problem->confirmed_local) ], - 'updated_datetime' => [ w3date($problem->lastupdate_local) ], + 'requested_datetime' => [ w3date($problem->confirmed) ], + 'updated_datetime' => [ w3date($problem->lastupdate) ], # 'expected_datetime' => [ {} ], # 'address' => [ {} ], # 'address_id' => [ {} ], @@ -260,7 +260,7 @@ sub output_requests : Private { if ( $problem->whensent ) { # Not in Open311 v2 $request->{'agency_sent_datetime'} = - [ w3date($problem->whensent_local) ]; + [ w3date($problem->whensent) ]; } # Extract number of updates |