diff --git a/config.default.php b/config.default.php index 5cd832e..95c570b 100644 --- a/config.default.php +++ b/config.default.php @@ -7,3 +7,5 @@ $database = array( 'database' => "temp", ); +$start_year_of_recordings=2012; + diff --git a/function.php b/function.php index 4bdcf3f..30d0e4e 100644 --- a/function.php +++ b/function.php @@ -314,9 +314,13 @@ function drawChart($myData,$target,$date,$type){ $myPicture->Render($target); } -function calendarDay($day,$year,$month,$selection){ +function calendarDay($day,$year,$month,$selection, $future){ $baselink="&year=".$year."&month=".$month."&day=".$day."'"; - return tempLink($baselink,$day,($selection=="temp")).humiLink($baselink,($selection=="humi")).ambiLink($baselink,($selection=="ambi")).baroLink($baselink,($selection=="baro")); + if($future){ + return $day." (H A B)"; + }else{ + return tempLink($baselink,$day,($selection=="temp")).humiLink($baselink,($selection=="humi")).ambiLink($baselink,($selection=="ambi")).baroLink($baselink,($selection=="baro")); + } } function tempLink($baselink,$day,$selected=false){ $link="\n\t<< ".$month." >>\n\n"; + $show['prev']=$prevYear >= $start_year_of_recordings; + $show['next']=! isFuture(array(date("j"),date("n"),date("Y")), 0, $nextMonth, $nextYear); + $links="
\n"; + return $links; +} +function monthToName($month){ + $dateObj = DateTime::createFromFormat('!m', $month); + $monthName = $dateObj->format('F'); + return $monthName; } function prependZero($number){ return ($number<10)? "0".$number : $number; @@ -393,7 +419,8 @@ function drawCalendar($date,$type){ }else{ $calendar.="\t\t