Hi everyone,
So firstly, I apologise for the length of the email but I tried to explain and give examples.
I recently moved from PC / Cumulus 1.9.4 to Raspberry PI / Cumulus MX and everything is working fine except the Month and Year pages do not display the recorded date / time correctly.
If you take a look here (website running Cumulus MX)
http://midlifedad.me.uk/weather/thismonth.php and then compare to my friends website here (running Cumulus 1.9.4)
http://dal-y-gwynt.me.uk/weather/thismonth.php you will see the difference in the right hand column. Both sites are based on the original WB2 templates just wth a lot of modification but the php usage is taken directly from there.
I looked in to this and can see that the way the data is interpreted in the wt_dat_inc files and the results produced are different.
In 1.9.4 the line below in the monthly section
if (!is_numeric("<#MonthTempHD format='m'>")) $MonthTempHF = "<#MonthTempHD>"; else
$MonthTempHF = $pre_time.$MonthTempHT.$pre_date."<#MonthTempHD format='d'> ".$Tr_monthnames["<#MonthTempHD format='m'>"];
returns the following data
if (!is_numeric("7")) $MonthTempHF = "01 July"; else
$MonthTempHF = $pre_time.$MonthTempHT.$pre_date."1 ".$Tr_monthnames["7"];
In MX, the same line returns
if (!is_numeric("m")) $MonthTempHF = "01 July"; else
$MonthTempHF = $pre_time.$MonthTempHT.$pre_date."d ".$Tr_monthnames["m"];
So it does not appear to be receiving or translating the "7" correctly.
I know there are some format changes for date and time in MX and I have tried using "M", "MM", "MMMM" instead of "m" but cannot get any to work.
My undertsnading of the above process (given my very limited PHP knowledge) is that if #MonthTempHD is not a single number for the month then the MonthTempHF variable should be set to #MonthTempHD and if it is a single month number then the MonthTempHF variable should be a combination of $pre_time.$MonthTempHT.$pre_date."<#MonthTempHD format='d'> ".$Tr_monthnames["<#MonthTempHD format='m'>"]; to give something like at 00:07 on 06 July.
Because it never seems to receive a single numerical month, for example "7" it always sets it to MonthTempHD variable, in this case 01 July.
There is a different problem for Lowest Winchill Temperature where it shows "time" d, but it is probably related.
I dont know if this an MX issue or if it is to do with the way the PHP template is handling the formatting. I read on the Cumulus website about standard strings and custom strings when looking at date / time format but unfortunately that went way beyond my knowledge.
I also noticed in this post
http://weatherbyyou.com/forum/index.php?topic=1254.0 that it is using MX and WB2 and has the same issue.
Any help or suggestions would be appreciated
Kind Regards
Andy