aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/Page.pm4
-rwxr-xr-xweb/ajax.cgi10
-rwxr-xr-xweb/index.cgi4
3 files changed, 11 insertions, 7 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/web/ajax.cgi b/web/ajax.cgi
index fa722f02e..69c389765 100755
--- a/web/ajax.cgi
+++ b/web/ajax.cgi
@@ -50,8 +50,8 @@ sub main {
all_pins => undef,
no_pins => undef), $q);
$list .= '<li><a href="' . $link . '">';
- $list .= ent($_->{title});
- $list .= '</a>';
+ $list .= ent($_->{title}) . '</a> <small>(';
+ $list .= Page::prettify_epoch($q, $_->{time}, 1) . ')</small>';
$list .= ' <small>' . _('(fixed)') . '</small>' if $_->{state} eq 'fixed';
$list .= '</li>';
}
@@ -59,6 +59,7 @@ sub main {
$list = '';
foreach (@$around_map) {
+ my $dist = int($_->{distance}/100+.5)/10;
$link = Cobrand::url($cobrand, NewURL($q, -retain => 1,
-url => '/report/' . $_->{id},
pc => undef,
@@ -69,8 +70,9 @@ sub main {
all_pins => undef,
no_pins => undef), $q);
$list .= '<li><a href="' . $link . '">';
- $list .= ent($_->{title}) . ' <small>(' . int($_->{distance}/100+.5)/10 . 'km)</small>';
- $list .= '</a>';
+ $list .= ent($_->{title}) . '</a> <small>(';
+ $list .= Page::prettify_epoch($q, $_->{time}, 1) . ', ';
+ $list .= $dist . 'km)</small>';
$list .= ' <small>' . _('(fixed)') . '</small>' if $_->{state} eq 'fixed';
$list .= '</li>';
}
diff --git a/web/index.cgi b/web/index.cgi
index 94502a74e..e503f50ba 100755
--- a/web/index.cgi
+++ b/web/index.cgi
@@ -821,7 +821,7 @@ sub display_location {
$report_url = Cobrand::url($cobrand, $report_url, $q);
$on_list .= '<li><a href="' . $report_url . '">';
$on_list .= ent($_->{title}) . '</a> <small>(';
- $on_list .= Page::prettify_epoch($q, $_->{time}) . ')</small>';
+ $on_list .= Page::prettify_epoch($q, $_->{time}, 1) . ')</small>';
$on_list .= ' <small>' . _('(fixed)') . '</small>' if $_->{state} eq 'fixed';
$on_list .= '</li>';
}
@@ -835,7 +835,7 @@ sub display_location {
my $dist = int($_->{distance}/100+0.5);
$dist = $dist / 10;
$around_list .= ent($_->{title}) . '</a> <small>(';
- $around_list .= Page::prettify_epoch($q, $_->{time}) . ', ';
+ $around_list .= Page::prettify_epoch($q, $_->{time}, 1) . ', ';
$around_list .= $dist . 'km)</small>';
$around_list .= ' <small>' . _('(fixed)') . '</small>' if $_->{state} eq 'fixed';
$around_list .= '</li>';