Welcome to the Cumulus Support forum.

Latest Cumulus MX release v3.2.3 build 3059 - 04 December 2019.
    Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014

    See the Wiki for downloading either version.

    ajaxdate

    Discussion of Ken True's web site templates

    Moderator: saratogaWX

    n9mfk
    Posts: 845
    Joined: Sun 10 May 2009 8:52 pm
    Weather Station: davis vp2 Serial datalogger
    Operating System: Windows 7 64-bit
    Location: Springfield, IL

    ajaxdate

    Post by n9mfk » 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

    BCJKiwi
    Posts: 885
    Joined: Mon 09 Jul 2012 8:40 pm
    Weather Station: Davis VP2 Cabled with Solar
    Operating System: Windows 10 Pro
    Location: Auckland, New Zealand
    Contact:

    Re: ajaxdate

    Post by BCJKiwi » Thu 15 Aug 2013 8:23 pm

    settings.php

    User avatar
    William Grimsley
    Posts: 833
    Joined: Thu 22 Sep 2011 5:22 pm
    Weather Station: Davis Vantage Vue
    Operating System: Windows 7 Home Premium 64-bit
    Location: Latitude: 50.70189285 Longitude: -3.30849957
    Contact:

    Re: ajaxdate

    Post by William Grimsley » Thu 15 Aug 2013 8:25 pm

    Yes.

    Change:

    Code: Select all

    $SITE['dateOnlyFormat'] = 'd/m/y';        // for 31-Mar-2008 or 'j/n/Y' for Euro format
    To:

    Code: Select all

    $SITE['dateOnlyFormat'] = 'd/m/Y';        // for 31-Mar-2008 or 'j/n/Y' for Euro format
    For the PHP.

    Then, (still keeping your existing realtime.txt file) create a new realtime.txt file like this.

    Code: 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>
    Save the new realtime.txt file in the Cumulus 'web' folder and set-up Cumulus to FTP that one instead of using the existing one. First, go to Configuration --> Internet. Then, un-tick the 'Enable Realtime FTP' box. Then, click the 'Files' tab and add in the local filenames field where you saved your new realtime.txt file or click 'Browse...'. Then, add in the remote filenames field 'realtime.txt' and tick all of the 'Process?', 'Realtime?' and 'FTP?' boxes.

    Sorry this is a long way to do but it's the only way to achieve and only takes a few minutes,

    Hope this helps,

    William
    Last edited by William Grimsley on Thu 15 Aug 2013 8:29 pm, edited 2 times in total.

    User avatar
    William Grimsley
    Posts: 833
    Joined: Thu 22 Sep 2011 5:22 pm
    Weather Station: Davis Vantage Vue
    Operating System: Windows 7 Home Premium 64-bit
    Location: Latitude: 50.70189285 Longitude: -3.30849957
    Contact:

    Re: ajaxdate

    Post by William Grimsley » Thu 15 Aug 2013 8:26 pm

    BCJKiwi wrote:settings.php
    No, that's only for the PHP part of it.

    BCJKiwi
    Posts: 885
    Joined: Mon 09 Jul 2012 8:40 pm
    Weather Station: Davis VP2 Cabled with Solar
    Operating System: Windows 10 Pro
    Location: Auckland, New Zealand
    Contact:

    Re: ajaxdate

    Post by BCJKiwi » Thu 15 Aug 2013 8:42 pm

    Yes, I was a little quick on the draw.
    ajaxCUwx.js picks up realtime[0] so unless you want to use a different format from what is in the PC Cumulus is using, you should not need to change anything.
    Perhaps the time format is not right in the Cumulus PC?

    n9mfk
    Posts: 845
    Joined: Sun 10 May 2009 8:52 pm
    Weather Station: davis vp2 Serial datalogger
    Operating System: Windows 7 64-bit
    Location: Springfield, IL

    Re: ajaxdate

    Post by n9mfk » Thu 15 Aug 2013 10:13 pm

    Hi All,
    not sure what happened to that post

    pc year set to full year 2013 that what im look for in the ajax


    thanks Beau
    Last edited by n9mfk on Fri 16 Aug 2013 1:17 am, edited 1 time in total.

    BCJKiwi
    Posts: 885
    Joined: Mon 09 Jul 2012 8:40 pm
    Weather Station: Davis VP2 Cabled with Solar
    Operating System: Windows 10 Pro
    Location: Auckland, New Zealand
    Contact:

    Re: ajaxdate

    Post by BCJKiwi » Thu 15 Aug 2013 11:07 pm

    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 ;)

    User avatar
    William Grimsley
    Posts: 833
    Joined: Thu 22 Sep 2011 5:22 pm
    Weather Station: Davis Vantage Vue
    Operating System: Windows 7 Home Premium 64-bit
    Location: Latitude: 50.70189285 Longitude: -3.30849957
    Contact:

    Re: ajaxdate

    Post by William Grimsley » Fri 16 Aug 2013 6:52 am

    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 ;)
    If Beau uses my method he will be able to achieve what he wants.

    User avatar
    gluepack
    Posts: 460
    Joined: Tue 22 Jan 2013 9:20 pm
    Weather Station: PCE-FWS 20
    Operating System: Win 7 Pro
    Location: Zlatina, Bulgaria

    Re: ajaxdate

    Post by gluepack » Fri 16 Aug 2013 5:19 pm

    well, except for the fact that he wants it m/d/y format.
    Image

    PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
    Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau

    User avatar
    William Grimsley
    Posts: 833
    Joined: Thu 22 Sep 2011 5:22 pm
    Weather Station: Davis Vantage Vue
    Operating System: Windows 7 Home Premium 64-bit
    Location: Latitude: 50.70189285 Longitude: -3.30849957
    Contact:

    Re: ajaxdate

    Post by William Grimsley » Fri 16 Aug 2013 5:28 pm

    gluepack wrote:well, except for the fact that he wants it m/d/y format.
    Ok, then he would just do this.

    Change:

    Code: Select all

    $SITE['dateOnlyFormat'] = 'd/m/Y';        // for 31-Mar-2008 or 'j/n/Y' for Euro format
    To:

    Code: Select all

    $SITE['dateOnlyFormat'] = 'm/d/Y';        // for 31-Mar-2008 or 'j/n/Y' for Euro format
    And:

    Change:

    Code: 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>
    To:

    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>

    gemini06720
    Posts: 1700
    Joined: Mon 10 Aug 2009 10:16 pm
    Weather Station: No weather station
    Operating System: No operating system
    Location: World...

    Re: ajaxdate

    Post by gemini06720 » Sat 17 Aug 2013 2:05 am

    n9mfk wrote:is there a a way to change ajaxdate format from 08/15/13 to 08/15/2013
    Not an easy way, unfortunately.

    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.... ;)

    User avatar
    William Grimsley
    Posts: 833
    Joined: Thu 22 Sep 2011 5:22 pm
    Weather Station: Davis Vantage Vue
    Operating System: Windows 7 Home Premium 64-bit
    Location: Latitude: 50.70189285 Longitude: -3.30849957
    Contact:

    Re: ajaxdate

    Post by William Grimsley » Sat 17 Aug 2013 7:54 am

    gemini06720 wrote:
    n9mfk wrote:is there a a way to change ajaxdate format from 08/15/13 to 08/15/2013
    Not an easy way, unfortunately.

    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.... ;)
    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
    Posts: 1700
    Joined: Mon 10 Aug 2009 10:16 pm
    Weather Station: No weather station
    Operating System: No operating system
    Location: World...

    Re: ajaxdate

    Post by gemini06720 » Sat 17 Aug 2013 8:29 am

    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.
    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.

    User avatar
    William Grimsley
    Posts: 833
    Joined: Thu 22 Sep 2011 5:22 pm
    Weather Station: Davis Vantage Vue
    Operating System: Windows 7 Home Premium 64-bit
    Location: Latitude: 50.70189285 Longitude: -3.30849957
    Contact:

    Re: ajaxdate

    Post by William Grimsley » Sat 17 Aug 2013 2:15 pm

    gemini06720 wrote:
    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.
    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.
    It saves a lot of hastle though.

    User avatar
    gluepack
    Posts: 460
    Joined: Tue 22 Jan 2013 9:20 pm
    Weather Station: PCE-FWS 20
    Operating System: Win 7 Pro
    Location: Zlatina, Bulgaria

    Re: ajaxdate

    Post by gluepack » Sat 17 Aug 2013 9:27 pm

    And Band-Aids are designed to last a lot longer nowadays. Invariably they have to ;)
    Image

    PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
    Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau

    Post Reply