Prechádzať zdrojové kódy

Fixed Leap Year Code

There still maybe some issues with this code but I believe I have fixed it.
Josh Smith 4 rokov pred
rodič
commit
67cecfe2ef
1 zmenil súbory, kde vykonal 13 pridanie a 10 odobranie
  1. 13 10
      index.html.tmpl

+ 13 - 10
index.html.tmpl

@@ -411,8 +411,8 @@
               #end if
             </table>
           </div>
-          
-            <!--Leap Year Code -->
+          <!--Leap Year Code -->
+            <!--If this year was a leap year -->
             #set $yr = int($day.dateTime.format("%Y"))%4
             #if $yr == 0
               #if $yr % 100 == 0
@@ -437,17 +437,20 @@
                 #end if
               #end if
             #else
-              #set $yrNew = ($yr - 1)
-            #if $yrNew % 100 == 0
-              #if $yrNew % 400 == 0
-                #if $day.dateTime.format("%d-%b") < '01-Mar'
-                  #set $n = 367
+            <!--If last year was a leap year -->
+            #set $yrNew = ($yr - 1)
+              #if $yrNew % 100 == 0
+                #if $yrNew % 400 == 0
+                  #if $day.dateTime.format("%d-%b") < '01-Mar'
+                    #set $n = 366
+                  #else
+                    #set $n = 365
+                  #end if
                 #else
-                  #set $n = 366
+                  #set $n = 365
                 #end if
-              #end if
               #else
-                #set $n = 366
+                #set $n = 365
               #end if
             #end if
 	  #if $days_ago($days_ago=$n).outTemp.max.string != "   N/A"