aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Rss.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/FixMyStreet/App/Controller/Rss.pm
parentc061769ba72f420e2f2c6064fa526648e57339f1 (diff)
parent5b2e18389734751165d2eeb21a3b3f2e8d2e8755 (diff)
Merge remote branch 'origin/master' into oxfordshire-header
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Rss.pm')
-rwxr-xr-xperllib/FixMyStreet/App/Controller/Rss.pm11
1 files changed, 10 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Rss.pm b/perllib/FixMyStreet/App/Controller/Rss.pm
index baaa3b927..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 {
@@ -257,7 +266,7 @@ sub add_row : Private {
my $hashref_restriction = $c->cobrand->site_restriction;
my $base_url = $c->cobrand->base_url;
- if ( $hashref_restriction && $hashref_restriction->{council} && $row->{council} && $row->{council} ne $hashref_restriction->{council} ) {
+ if ( $hashref_restriction && $hashref_restriction->{bodies_str} && $row->{bodies_str} && $row->{bodies_str} ne $hashref_restriction->{bodies_str} ) {
$base_url = $c->config->{BASE_URL};
}
my $url = $base_url . $link;