aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Open311/GetServiceRequestUpdates.pm
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2018-06-08 11:37:26 +0100
committerStruan Donald <struan@exo.org.uk>2018-06-08 14:17:33 +0100
commitee64aab278b76c69436a560e05242a833c1b7d6d (patch)
treefcb657c9f7b3bd5fd3c6bff608d906387720938e /perllib/Open311/GetServiceRequestUpdates.pm
parentbb5a526e700d9f9f4568a0defc0241d7999f79ee (diff)
[Oxfordshire] use localtime in open311 get update call
As Oxfordshire uses local time and not UTC use that when calling the get update script. Also handle a date with a timezone being passed on the server side. And add some tests in for the oxfordshire open311 endpoint Fixes mysociety/fixmystreet-commercial#1062
Diffstat (limited to 'perllib/Open311/GetServiceRequestUpdates.pm')
-rw-r--r--perllib/Open311/GetServiceRequestUpdates.pm2
1 files changed, 2 insertions, 0 deletions
diff --git a/perllib/Open311/GetServiceRequestUpdates.pm b/perllib/Open311/GetServiceRequestUpdates.pm
index b4d7c6347..7cbfc7192 100644
--- a/perllib/Open311/GetServiceRequestUpdates.pm
+++ b/perllib/Open311/GetServiceRequestUpdates.pm
@@ -69,6 +69,8 @@ sub update_comments {
# default to asking for last 2 hours worth if not Bromley
} elsif ( ! $body->areas->{$AREA_ID_BROMLEY} ) {
my $end_dt = DateTime->now();
+ # Oxfordshire uses local time and not UTC for dates
+ FixMyStreet->set_time_zone($end_dt) if ( $body->areas->{$AREA_ID_OXFORDSHIRE} );
my $start_dt = $end_dt->clone;
$start_dt->add( hours => -2 );