aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Utils.pm
diff options
context:
space:
mode:
authorDave Whiteland <dave@mysociety.org>2013-02-06 15:08:23 +0000
committerDave Whiteland <dave@mysociety.org>2013-02-06 15:08:23 +0000
commit0f24a44cd6e8b056db482cb91c85768b6d1e7d1d (patch)
tree09a90f38574ee62754f3c8ac077152ed99a38296 /perllib/Utils.pm
parentc061769ba72f420e2f2c6064fa526648e57339f1 (diff)
parent5b2e18389734751165d2eeb21a3b3f2e8d2e8755 (diff)
Merge remote branch 'origin/master' into oxfordshire-header
Diffstat (limited to 'perllib/Utils.pm')
-rw-r--r--perllib/Utils.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/perllib/Utils.pm b/perllib/Utils.pm
index fa90620a0..04d973067 100644
--- a/perllib/Utils.pm
+++ b/perllib/Utils.pm
@@ -221,12 +221,11 @@ 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');
@@ -243,6 +242,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')) {