You seem to have Settings.php with
Code: Select all
$SITE['monthNames'] = array( // for wxastronomy page .. replace with month names in your language
'Tammikuu','Helmikuu','Maaliskuu','Huhtikuu','Toukokuu','Kesäkuu',
'Heinäkuu','Elokuu','Syyskuu','Lokakuu','Marraskuu','Joulukuu'
);
so the routine inside CU-defs.php
Code: Select all
#-------------------------------------------------------------------------------------
# CU support function - CU_getRecordDate - Convert 'dd Month '.'YYYY' to list(d,m,y)
#-------------------------------------------------------------------------------------
function CU_getRecordDate($inDayMonth,$inYear) {
global $SITE,$Debug;
$EnglishMonths = array(
'January','February','March','April','May','June',
'July','August','September','October','November','December');
$tstr = $inDayMonth . ' ' . $inYear;
$Debug .= "<!-- CU_getRecordDate input tstr='$tstr' -->\n";
// input dates are assumed to be in English only
if (isset($SITE['monthNames'])) {
// convert TO English for strtotime()
foreach ($EnglishMonths as $i => $monthEN) {
$tstr = preg_replace('|'.$SITE['monthNames'][$i].'|i',$monthEN,$tstr);
}
$Debug .= "<!-- CU_getRecordDate after tstr='$tstr' -->\n";
}
$ttime = strtotime($tstr);
$ltime = date('j n Y',$ttime);
$Debug .= "<!-- CU_getRecordDate result ltime='$ltime' -->\n";
return(explode(' ',$ltime));
}
should convert the dates to English for calculation as long as the $SITE['monthNames'] array is set to match the month names used in CUtags.php.
Doing a
http://www.kapo511.net/wxtrends.php?debug=y then a view-source of the page shows
<!-- CU_getRecordDate input tstr='01 kesäkuu 2013' -->
<!-- CU_getRecordDate after tstr='01 kesäkuu 2013' -->
<!-- CU_getRecordDate result ltime='1 1 1970' -->
<!-- CU_getRecordDate input tstr='31 tammikuu 2013' -->
<!-- CU_getRecordDate after tstr='31 January 2013' -->
<!-- CU_getRecordDate result ltime='31 1 2013' -->
<!-- CU_getAlltimeDate input inDate='at 17:02 on 03 kesäkuu 2013' -->
<!-- CU_getAlltimeDate after tstr='03 kesäkuu 2013 17:02' -->
<!-- CU_getAlltimeDate result ltime='1 1 1970 02:00' -->
<!-- CU_getAlltimeDate input inDate='at 9:20 on 18 tammikuu 2013' -->
<!-- CU_getAlltimeDate after tstr='18 January 2013 9:20' -->
<!-- CU_getAlltimeDate result ltime='18 1 2013 09:20' -->
<!-- CU_getRecordDate input tstr='03 kesäkuu 2013' -->
<!-- CU_getRecordDate after tstr='03 kesäkuu 2013' -->
<!-- CU_getRecordDate result ltime='1 1 1970' -->
which shows it is working for the month 'tammikuu' (January), but not for the month 'kesäkuu' (June).
The only reasons I can think of that it is failing is either:
1) the Settings.php was not uploaded in ASCII using ISO-8859-1 character set so the 'ä' is not the correct code in the CU-tags.php uploaded by Cumulus
or
2) your Settings.php has the month name as 'Kesäkuu' instead of 'Kesäkuu' (in ISO-8859-1).
Best regards,
Ken