aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-11-16 13:45:13 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-11-16 13:47:59 +0000
commit03951604640490c9923a23782f485562b00ac592 (patch)
tree3c3ac46d2ead89df2eb31c2f812d3433eab9151a
parentffe002094e634462ba2ae303f3ee5cdf090ac1fc (diff)
Treat dashboard end date as that given, inclusive.
If someone selects 15-16th November, they want reports from both those dates, not just the 15th.
-rw-r--r--perllib/FixMyStreet/App/Controller/Dashboard.pm5
-rw-r--r--t/app/controller/dashboard.t2
2 files changed, 4 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Dashboard.pm b/perllib/FixMyStreet/App/Controller/Dashboard.pm
index 7f4a4bb27..27661b736 100644
--- a/perllib/FixMyStreet/App/Controller/Dashboard.pm
+++ b/perllib/FixMyStreet/App/Controller/Dashboard.pm
@@ -166,8 +166,9 @@ sub index : Path : Args(0) {
$c->stash->{start_date} = $c->get_param('start_date');
}
if ($c->get_param('end_date')) {
+ my $one_day = DateTime::Duration->new( days => 1 );
my $date = $dtf->parse_datetime( $c->get_param('end_date') );
- push @parts, { '<=', $dtf->format_datetime( $date ) };
+ push @parts, { '<', $dtf->format_datetime( $date + $one_day ) };
$c->stash->{end_date} = $c->get_param('end_date');
}
@@ -232,7 +233,7 @@ sub export_as_csv {
'Closed',
'Status',
'Latitude', 'Longitude',
- 'Nearest Postcode',
+ 'Query',
'Ward',
'Easting',
'Northing',
diff --git a/t/app/controller/dashboard.t b/t/app/controller/dashboard.t
index 3a22d4280..c1706cc81 100644
--- a/t/app/controller/dashboard.t
+++ b/t/app/controller/dashboard.t
@@ -621,7 +621,7 @@ FixMyStreet::override_config {
'Status',
'Latitude',
'Longitude',
- 'Nearest Postcode',
+ 'Query',
'Ward',
'Easting',
'Northing',