aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-04-16 09:21:57 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-04-16 09:21:57 +0100
commit461430079384a10fb9e433dcc7581af2a56c0fac (patch)
treeb956a292314c131d7142ccfacebdbf567de5632f
parent7acc080371d97d6958546349babd7701654fe2b2 (diff)
[Oxfordshire] Fix admin exor download page.
07906f40 changed the HTML date input form, but did not update the server parsing of the format.
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin/ExorDefects.pm2
-rw-r--r--t/cobrand/oxfordshire.t8
2 files changed, 5 insertions, 5 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin/ExorDefects.pm b/perllib/FixMyStreet/App/Controller/Admin/ExorDefects.pm
index bdeecc1a3..d965dd8f2 100644
--- a/perllib/FixMyStreet/App/Controller/Admin/ExorDefects.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin/ExorDefects.pm
@@ -43,7 +43,7 @@ sub download : Path('download') : Args(0) {
$c->detach( '/page_error_404_not_found', [] );
}
- my $parser = DateTime::Format::Strptime->new( pattern => '%d/%m/%Y' );
+ my $parser = DateTime::Format::Strptime->new( pattern => '%Y-%m-%d' );
my $start_date = $parser-> parse_datetime ( $c->get_param('start_date') );
my $end_date = $parser-> parse_datetime ( $c->get_param('end_date') ) ;
my $one_day = DateTime::Duration->new( days => 1 );
diff --git a/t/cobrand/oxfordshire.t b/t/cobrand/oxfordshire.t
index 54c6e32ea..f5abde27f 100644
--- a/t/cobrand/oxfordshire.t
+++ b/t/cobrand/oxfordshire.t
@@ -81,8 +81,8 @@ subtest 'Exor file looks okay' => sub {
$mech->log_in_ok( $superuser->email );
$mech->get_ok('/admin/exordefects');
$mech->submit_form_ok( { with_fields => {
- start_date => '05/05/2017',
- end_date => '05/05/2017',
+ start_date => '2017-05-05',
+ end_date => '2017-05-05',
user_id => $inspector->id,
} }, 'submit download');
$mech->content_contains("No inspections by that inspector in the selected date range");
@@ -120,8 +120,8 @@ subtest 'Exor file looks okay' => sub {
$i++;
}
$mech->submit_form_ok( { with_fields => {
- start_date => '05/05/2017',
- end_date => '05/05/2017',
+ start_date => '2017-05-05',
+ end_date => '2017-05-05',
user_id => $inspector->id,
} }, 'submit download');
(my $rdi = $mech->content) =~ s/\r\n/\n/g;