aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
Diffstat (limited to 'perllib')
-rw-r--r--perllib/Page.pm4
-rw-r--r--perllib/Problems.pm7
2 files changed, 8 insertions, 3 deletions
diff --git a/perllib/Page.pm b/perllib/Page.pm
index 917fc6991..817a56761 100644
--- a/perllib/Page.pm
+++ b/perllib/Page.pm
@@ -444,7 +444,7 @@ EOF
}
sub prettify_epoch {
- my ($q, $s) = @_;
+ my ($q, $s, $short) = @_;
my $cobrand = get_cobrand($q);
my $cobrand_datetime = Cobrand::prettify_epoch($cobrand, $s);
return $cobrand_datetime if ($cobrand_datetime);
@@ -455,6 +455,8 @@ sub prettify_epoch {
$tt = "$tt " . _('today');
} elsif (strftime('%Y %U', @s) eq strftime('%Y %U', @t)) {
$tt = "$tt, " . strftime('%A', @s);
+ } elsif ($short) {
+ $tt = "$tt, " . strftime('%e %b %Y', @s);
} elsif (strftime('%Y', @s) eq strftime('%Y', @t)) {
$tt = "$tt, " . strftime('%A %e %B %Y', @s);
} else {
diff --git a/perllib/Problems.pm b/perllib/Problems.pm
index 788074e37..1556b7724 100644
--- a/perllib/Problems.pm
+++ b/perllib/Problems.pm
@@ -176,7 +176,9 @@ sub around_map {
$limit_clause = " limit $limit";
}
mySociety::Locale::in_gb_locale { select_all(
- "select id,title,easting,northing,state from problem
+ "select id,title,easting,northing,state,
+ extract(epoch from confirmed) as time
+ from problem
where state in ('confirmed', 'fixed')
and easting>=? and easting<? and northing>=? and northing<? " .
($interval ? " and ms_current_timestamp()-lastupdate < '$interval'::interval" : '') .
@@ -189,7 +191,8 @@ sub around_map {
sub nearby {
my ($dist, $ids, $limit, $mid_e, $mid_n, $interval) = @_;
mySociety::Locale::in_gb_locale { select_all(
- "select id, title, easting, northing, distance, state
+ "select id, title, easting, northing, distance, state,
+ extract(epoch from confirmed) as time
from problem_find_nearby(?, ?, $dist) as nearby, problem
where nearby.problem_id = problem.id " .
($interval ? " and ms_current_timestamp()-lastupdate < '$interval'::interval" : '') .