madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r20796: LJSUP-10756: Minimalism style. Links at ...

Committer: sbelyaev
LJSUP-10756: Minimalism style. Links at the calendar does not work
U   trunk/cgi-bin/LJ/ControlStrip.pm
Modified: trunk/cgi-bin/LJ/ControlStrip.pm
===================================================================
--- trunk/cgi-bin/LJ/ControlStrip.pm	2011-12-16 09:42:55 UTC (rev 20795)
+++ trunk/cgi-bin/LJ/ControlStrip.pm	2011-12-16 11:37:31 UTC (rev 20796)
@@ -354,19 +354,28 @@
     my $daycounts = LJ::get_daycounts($journal, $remote);
     if (@$daycounts) {
         my @early_date = @{$daycounts->[0]};
-        my @last_date = @{$daycounts->[-1]};
+        my @last_date  = @{$daycounts->[-1]};
         pop @early_date;
         pop @last_date;
 
+        if (@last_date[1] != 0) {
+            @last_date[1] -= 1;
+        }
+
+        if (@early_date[1] != 0) {
+            @early_date[1] -= 1;
+        }
+
         my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
             gmtime();
         if ( @last_date[0] < ($year + 1900) ||
-             @last_date[1] < ($mon + 1)     ||
+             @last_date[1] < $mon     ||
              @last_date[2] < $mday )
         {
-            @last_date = ($year + 1900, $mon + 1, $mday);
+            @last_date = ($year + 1900, $mon, $mday);
         }
 
+
         $tmpl->param( 'EARLY_DATE' => join(',', @early_date),
                       'LAST_DATE'  => join(',', @last_date));
     }

Tags: livejournal, madeon, pm, sbelyaev
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments