aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Utils.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/Utils.pm')
-rw-r--r--perllib/Utils.pm18
1 files changed, 8 insertions, 10 deletions
diff --git a/perllib/Utils.pm b/perllib/Utils.pm
index fa90620a0..7a22c888d 100644
--- a/perllib/Utils.pm
+++ b/perllib/Utils.pm
@@ -123,7 +123,9 @@ sub london_categories {
}
sub barnet_categories {
- # The values here are KBIDs from Barnet's system: see bin/send-reports for formatting
+ # The values here are KBIDs from Barnet's system: see bin/send-reports for formatting.
+ # They are no longer used since Barnet switched to email for delivery of problem reports.
+ # and can be removed when SendReport/Barnet.pm is removed.
if (mySociety::Config::get('STAGING_SITE')) { # note staging site must use different KBIDs
return {
'Street scene misc' => 14 # for test
@@ -221,18 +223,12 @@ sub cleanup_text {
return $input;
}
-sub prettify_epoch {
- my ( $epoch, $type ) = @_;
+sub prettify_dt {
+ my ( $dt, $type ) = @_;
$type ||= '';
$type = 'short' if $type eq '1';
- my $dt = DateTime->from_epoch( epoch => $epoch, time_zone => 'local' );
- $dt->set_time_zone( FixMyStreet->config('TIME_ZONE') )
- if FixMyStreet->config('TIME_ZONE');
-
- my $now = DateTime->now( time_zone => 'local' );
- $now->set_time_zone( FixMyStreet->config('TIME_ZONE') )
- if FixMyStreet->config('TIME_ZONE');
+ my $now = DateTime->now( time_zone => FixMyStreet->config('TIME_ZONE') || 'local' );
my $tt = '';
$tt = $dt->strftime('%H:%M') unless $type eq 'date';
@@ -243,6 +239,8 @@ sub prettify_epoch {
$tt .= ', ' unless $type eq 'date';
if ($dt->strftime('%Y %U') eq $now->strftime('%Y %U')) {
$tt .= decode_utf8($dt->strftime('%A'));
+ } elsif ($type eq 'zurich') {
+ $tt .= decode_utf8($dt->strftime('%e. %B %Y'));
} elsif ($type eq 'short') {
$tt .= decode_utf8($dt->strftime('%e %b %Y'));
} elsif ($dt->strftime('%Y') eq $now->strftime('%Y')) {