ajaxdate
Posted: Thu 15 Aug 2013 6:17 pm
Hi Ken,
is there a a way to change ajaxdate format from 08/15/13 to 08/15/2013
Thanks Beau
is there a a way to change ajaxdate format from 08/15/13 to 08/15/2013
Thanks Beau
Support forum for Cumulus weather station software
https://cumulus.hosiene.co.uk/
Code: Select all
$SITE['dateOnlyFormat'] = 'd/m/y'; // for 31-Mar-2008 or 'j/n/Y' for Euro formatCode: Select all
$SITE['dateOnlyFormat'] = 'd/m/Y'; // for 31-Mar-2008 or 'j/n/Y' for Euro formatCode: Select all
<#date format=dd/mm/yyyy> <#timehhmmss> <#temp> <#hum> <#dew> <#wspeed> <#wlatest> <#bearing> <#rrate> <#rfall> <#press> <#currentwdir> <#beaufortnumber> <#windunit> <#tempunitnodeg> <#pressunit> <#rainunit> <#windrun> <#presstrendval> <#rmonth> <#ryear> <#rfallY> <#intemp> <#inhum> <#wchill> <#temptrend> <#tempTH> <#TtempTH> <#tempTL> <#TtempTL> <#windTM> <#TwindTM> <#wgustTM> <#TwgustTM> <#pressTH> <#TpressTH> <#pressTL> <#TpressTL> <#version> <#build> <#wgust> <#heatindex> <#humidex> <#UV> <#ET> <#SolarRad> <#avgbearing> <#rhour> <#forecastnumber> <#isdaylight> <#SensorContactLost> <#wdir> <#cloudbasevalue> <#cloudbaseunit> <#apptemp> <#SunshineHours> <#CurrentSolarMax> <#IsSunny>No, that's only for the PHP part of it.BCJKiwi wrote:settings.php
If Beau uses my method he will be able to achieve what he wants.BCJKiwi wrote:Beau,
That's a bit cryptic.
Do you mean you want the full year 1/2/2013 instead of 1/2/13?
If so, there is a lot of this century to go so maybe in ajaxCUwx.js you could just add 20 on to the front of the year
Ok, then he would just do this.gluepack wrote:well, except for the fact that he wants it m/d/y format.
Code: Select all
$SITE['dateOnlyFormat'] = 'd/m/Y'; // for 31-Mar-2008 or 'j/n/Y' for Euro formatCode: Select all
$SITE['dateOnlyFormat'] = 'm/d/Y'; // for 31-Mar-2008 or 'j/n/Y' for Euro formatCode: Select all
<#date format=dd/mm/yyyy> <#timehhmmss> <#temp> <#hum> <#dew> <#wspeed> <#wlatest> <#bearing> <#rrate> <#rfall> <#press> <#currentwdir> <#beaufortnumber> <#windunit> <#tempunitnodeg> <#pressunit> <#rainunit> <#windrun> <#presstrendval> <#rmonth> <#ryear> <#rfallY> <#intemp> <#inhum> <#wchill> <#temptrend> <#tempTH> <#TtempTH> <#tempTL> <#TtempTL> <#windTM> <#TwindTM> <#wgustTM> <#TwgustTM> <#pressTH> <#TpressTH> <#pressTL> <#TpressTL> <#version> <#build> <#wgust> <#heatindex> <#humidex> <#UV> <#ET> <#SolarRad> <#avgbearing> <#rhour> <#forecastnumber> <#isdaylight> <#SensorContactLost> <#wdir> <#cloudbasevalue> <#cloudbaseunit> <#apptemp> <#SunshineHours> <#CurrentSolarMax> <#IsSunny>Code: Select all
<#date format=mm/dd/yyyy> <#timehhmmss> <#temp> <#hum> <#dew> <#wspeed> <#wlatest> <#bearing> <#rrate> <#rfall> <#press> <#currentwdir> <#beaufortnumber> <#windunit> <#tempunitnodeg> <#pressunit> <#rainunit> <#windrun> <#presstrendval> <#rmonth> <#ryear> <#rfallY> <#intemp> <#inhum> <#wchill> <#temptrend> <#tempTH> <#TtempTH> <#tempTL> <#TtempTL> <#windTM> <#TwindTM> <#wgustTM> <#TwgustTM> <#pressTH> <#TpressTH> <#pressTL> <#TpressTL> <#version> <#build> <#wgust> <#heatindex> <#humidex> <#UV> <#ET> <#SolarRad> <#avgbearing> <#rhour> <#forecastnumber> <#isdaylight> <#SensorContactLost> <#wdir> <#cloudbasevalue> <#cloudbaseunit> <#apptemp> <#SunshineHours> <#CurrentSolarMax> <#IsSunny>Not an easy way, unfortunately.n9mfk wrote:is there a a way to change ajaxdate format from 08/15/13 to 08/15/2013
Yes, but if you just created a new realtime.txt file with the web tags like I've done above and change to what I've changed above. Then, surely that will work.gemini06720 wrote:Not an easy way, unfortunately.n9mfk wrote:is there a a way to change ajaxdate format from 08/15/13 to 08/15/2013
The AJAX 'ajaxCUwx.js' JavaScript gets its date from the 'realtime.txt' near real time data file - according to the Wiki documentation for the Cumulus produced 'realtime.txt' data file, the data format is always 'dd/mm/yy' (ie: date number/month number/year number).
Looking at the source code of 'ajaxCUwx.js' (starting at line #898), no processing and no modification is done to the date - it is just displayed as it is read, as it is produced by Cumulus.
The only way to get a different date format would be to add some lines of code to the 'ajaxCUwx.js' JavaScript, lines that would extract the individual components of the date (ie: the date number, the month number and the year number) and convert those individual components into a more 'human readable' date display.
Oh, by the way, all other suggestions can easily be used with PHP scripts but not as easily with an AJAX script....
William, your solution is good but it is, in my view, just a 'band aid' solution - it does not correct the limitation of the AJAX 'ajaxCUwx.js' JavaScript.William Grimsley wrote:...but if you just created a new realtime.txt file with the web tags like I've done above and change to what I've changed above. Then, surely that will work.
It saves a lot of hastle though.gemini06720 wrote:William, your solution is good but it is, in my view, just a 'band aid' solution - it does not correct the limitation of the AJAX 'ajaxCUwx.js' JavaScript.William Grimsley wrote:...but if you just created a new realtime.txt file with the web tags like I've done above and change to what I've changed above. Then, surely that will work.