Merge commit '2545d27aacfe57c8f26fccfd45e382fbf5c111ac'
[weathermon.git] / web / image_minmax.php
index dfa66d202a3aecdafd81a7a7ef9faccfb734b0ca..183942ba18f568a5699ed9201effad4292177670 100644 (file)
@@ -84,16 +84,17 @@ if ($type and $param) {
     $next_year = $year;
     $next_month = $month+1;
 
-    if ($month==13) {
+    if ($month==12) {
     
       $next_year++;
       $next_month=1;
-    
+
     }
 
     $curr = date("Ym");
+    $ym=sprintf('%04d%02d',$next_year,$next_month);
     
-    if ($curr>$next_year.$next_month) {
+    if ($curr>$ym) {
     
       $cachefilename='meteo.month.'.$sensor.'.'.$param.'.'.$to_unit.'.'.$year.'-'.$month.'.'.$img_format;