vpokroglo wrote:Thanks Ken for your reply.
I have done al the updates You say and some things are realy better, but Month gust date in dashboard is still wrong. its showing Gust Month: 32,4 km/h Jan 6 . But this gust was today on 6 sep, not jan 6.
Thanks!
The code that generates the Gust Month display in ajax-dashboard.php is
Code: Select all
<?php if(isset($mrecordwindgust)) { ?>
<tr>
<td colspan="2" class="data1" align="center">
<?php langtrans('Gust Month'); ?>: <?php echo $mrecordwindgust. " $uomWind"; ?>
<?php if(isset($mrecordhighgustday)) { ?>
<?php echo substr($monthname,0,3) . " " . $mrecordhighgustday; ?>
<?php } // $mrecordhighgustday ?>
</td>
</tr>
<?php } // $mrecordwindgust ?>
and the code in CU-defs.php that fills those variables is
Code: Select all
$mrecordwindgust = $WX['MonthGustH'];
list($mrecordhighgustday,$mrecordhighgustmonth,$mrecordhighgustyear)=CU_getRecordDate($WX['MonthGustHD'],$WX['year']); // calculated value
# generate the separate date/time variables by dissection of input date/time and format
list($date_year,$date_month,$date_day,$time_hour,$time_minute,$monthname,$dayname)
= CU_setDateTimes($date,$time,$SITE['WDdateMDY']);
Your CUtags.php?sce=dump has
Code: Select all
$WX['MonthGustH'] = '35,3';
$WX['MonthGustHT'] = '11:00';
$WX['MonthGustHD'] = '06 september';
Running your home page with ?debug=y and viewing the source shows
Code: Select all
<!-- CU_setDateTimes CUtime='2000--6.9.2011 16:55:00' assembled -->
<!-- CU_setDateTimes CUtime='1970 01 01 01 00 January Thursday' values set -->
So the issue is the date format in $WX['date'] = '6.9.2011';
is the underlying cause. So... change your CU-defs.php from
Code: Select all
$d = explode('/',$indate);
if(!isset($d[2])) {$d = explode("-",$indate);}
to
Code: Select all
$d = explode('/',$indate);
if(!isset($d[2])) {$d = explode("-",$indate);}
if(!isset($d[2])) {$d = explode(".",$indate);}
and that should fix the date issue.
Sorry for the long post.. I just wanted to show the debug process so you could see how it all ties together.
I'll make the update to CU-defs.php for the next distribution.
Best regards,
Ken