Web Weather > Weather Website PHP/AJAX scripting

01/01/1970 and Warmest / Coldest Day

(1/2) > >>

gand:
Hi
I have just installed the World Saratoga template and I'm using the WeeWx plugin. Everything seems to be fine except the Warmest / Coldest Day on the trend page. See screenshot.

The system is right now running local, so I can't provide an external link.

Could someone point me in the the right direction, where to start looking.

I have also attached the files genereated by  WeeWx.

Thanks
Gert

saratogaWX:
The variables doing that display in WEEWXtags.php are
--- Code: ---$mcoldestdayonrecord = '17,4C on: 17 maj 2021';
$mcoldestnightonrecord = '8,4C on: 17 maj 2021';
$mwarmestdayonrecord = '17,4C on: 17 maj 2021';
$mwarmestnightonrecord = '9,9C on: 16 maj 2021';

--- End code ---

The result of 1/1/1970 is due to 'maj' instead of 'May' in the data.
Have you setup Settings.php to have
--- Code: ---$SITE['monthNames'] = array(  // for wxastronomy page .. replace with month names in your language
"januar","februar","marts","april","maj","juni",
"juli","august","september","oktober","november","december");

--- End code ---
PHP (by default) expects the month names to be in English, and your data appears to have Danish month names.. add the above to Settings.php to replace the English default, and the dates should display correctly there and on the wxastronomy.php page too.

gand:
Hi

Thanks for looking. I did change that already and the astronomy page is fine.

Settings:

--- Quote ---// if your software uploads almanac dates using a language OTHER THAN English, please put the month
// names in your language to replace the English ones below.  This is used primarily by the
// wxastronomy.php page for the local dates of moon phases, solistices, and equinoxes
// $SITE['monthNames'] = array(  // for wxastronomy page .. replace with month names in your language
// 'January','February','March','April','May','June',
// 'July','August','September','October','November','December'
// );
// example:
$SITE['monthNames'] = array(  // Danish for wxastronomy page .. replace with month names in your language
'januar','februar','marts','april','maj','juni',
'juli','august','september','oktober','november','december'
);
--- End quote ---

Gert

saratogaWX:
I just looked at WEEWX-trends-inc.php and noticed it was missing the get_localdate() function used in wxastronomy.php

I'll add a function to that and post it later.. it's bedtime now for me :)

saratogaWX:
Try the attached.  It should just display the date as in the WEEWXtags.php if non-English dates are found.

I was thinking of doing the full translation (as done in wxastronomy), but.. the $SITE['monthNames'] only has the FULL names, not the abbreviations used, and it's chancy to assume 3 characters is the right number for abbreviated date names in other languages.
So.. I took the easy route: if your're running WeeWX with a non-English locale, the date format of that locale will display for those record entries on wxtrends.php

Navigation

[0] Message Index

[#] Next page

Go to full version