[Catalyst-commits] r14475 -
	trunk/examples/CatalystAdvent/lib/CatalystAdvent/Controller
    dpetrov at dev.catalyst.perl.org 
    dpetrov at dev.catalyst.perl.org
       
    Tue Dec  3 10:00:12 GMT 2013
    
    
  
Author: dpetrov
Date: 2013-12-03 10:00:12 +0000 (Tue, 03 Dec 2013)
New Revision: 14475
Modified:
   trunk/examples/CatalystAdvent/lib/CatalystAdvent/Controller/Calendar.pm
Log:
Show only entries that are not published already into the feed
Modified: trunk/examples/CatalystAdvent/lib/CatalystAdvent/Controller/Calendar.pm
===================================================================
--- trunk/examples/CatalystAdvent/lib/CatalystAdvent/Controller/Calendar.pm	2013-12-02 22:19:25 UTC (rev 14474)
+++ trunk/examples/CatalystAdvent/lib/CatalystAdvent/Controller/Calendar.pm	2013-12-03 10:00:12 UTC (rev 14475)
@@ -207,7 +207,10 @@
 
     $c->stash->{year} = $year;
 
-    my @entry = reverse 1 .. 24;
+    my $now = $c->stash->{now};
+
+    # get only not published entries
+    my @entry = reverse 1 .. ( $year == $now->year ? $now->day : 24 );
     my %path = map { $_ => $c->path_to( 'root', $year, "$_.pod" ) } @entry;
     @entry = grep -e $path{ $_ }, @entry;
     
    
    
More information about the Catalyst-commits
mailing list