diff options
author | Matthew Somerville <matthew@mysociety.org> | 2013-01-29 10:53:27 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2013-01-29 10:53:27 +0000 |
commit | 79401667983153582ca0a488f902e6775a543f11 (patch) | |
tree | db00f1d67d5a120cd31c3c0e79537dcf5f7e7948 | |
parent | d772dfa161d474943d10f25b89892317d0222543 (diff) |
Prettify created in RSS too.
-rwxr-xr-x | perllib/FixMyStreet/App/Controller/Rss.pm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Rss.pm b/perllib/FixMyStreet/App/Controller/Rss.pm index 8a43c0315..90ab7ad41 100755 --- a/perllib/FixMyStreet/App/Controller/Rss.pm +++ b/perllib/FixMyStreet/App/Controller/Rss.pm @@ -241,6 +241,15 @@ sub add_row : Private { $row->{name} = 'anonymous' if $row->{anonymous} || !$row->{name}; my $pubDate; + if ($row->{created}) { + $row->{created} =~ /^(\d\d\d\d)-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)/; + $pubDate = mySociety::Locale::in_gb_locale { + strftime("%a, %d %b %Y %H:%M:%S %z", $6, $5, $4, $3, $2-1, $1-1900, -1, -1, 0) + }; + $row->{created} = strftime("%e %B", $6, $5, $4, $3, $2-1, $1-1900, -1, -1, 0); + $row->{created} =~ s/^\s+//; + $row->{created} =~ s/^(\d+)/ordinal($1)/e if $c->stash->{lang_code} eq 'en-gb'; + } if ($row->{confirmed}) { $row->{confirmed} =~ /^(\d\d\d\d)-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)/; $pubDate = mySociety::Locale::in_gb_locale { |