Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

Changing webtags for Saratoga AJAX gizmo time

Discussion of Ken True's web site templates

Moderator: saratogaWX

Post Reply
rlee171
Posts: 9
Joined: Sun 17 Feb 2013 11:51 pm
Weather Station: Davis Vantage Pro 2
Operating System: Win 10
Location: Hot Springs, AR
Contact:

Changing webtags for Saratoga AJAX gizmo time

Post by rlee171 »

I am attempting to have the time in the Saratoga AJAX gizmo template display in the am pm format. It looks as though the CUtags.txt is where the change needs to made. I have read the Sandaysoft Wiki regarding webtags however I am still not quite sure exactly if the CUtags file is where to do the editing.

Thanks,

Ralph
Hot Springs National Park, AR
Davis Vantage Pro 2
Cumulus (1.9.4-b1099)
Blitzortung Stations: 1387 1445 2315
hsnpar.com
User avatar
saratogaWX
Posts: 1238
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: Changing webtags for Saratoga AJAX gizmo time

Post by saratogaWX »

The webtags (and CUtags.php) do support changing to am/pm time using the $SITE['timeFormat'] template in Settings.php

I think your issue may be with the AJAX script ajaxCUwx.js which simply uses the second field in realtime.txt to update the time .. that field is in 24hr hh:mm:ss format, and the ajaxCUwx.js does not currently have formatting capability for the ajaxtimeformat field.

Best regards,
Ken
User avatar
saratogaWX
Posts: 1238
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: Changing webtags for Saratoga AJAX gizmo time

Post by saratogaWX »

The 'original' realtime.txt produced by Cumulus is what the AJAX JavaScript ajaxCUwx.js uses to update some of the data displayed on the pages.

The code that does the time display in ajaxCUwx.js is

Code: Select all

		var ajaxtimeformat = realtime[1];
...
		set_ajax_obs("ajaxtime",ajaxtimeformat);
		set_ajax_obs("gizmotime",ajaxtimeformat);
I've done an update to the ajaxCUwx.js script to support optional AMPM time.

Demo: http://saratoga-weather.org/wxtemplates ... xindex.php

Try downloading http://saratoga-weather.org/wxtemplates ... jaxCUwx.js and uploading to your site .. it is already set for English units with AM/PM enabled.

Best regards,
Ken
rlee171
Posts: 9
Joined: Sun 17 Feb 2013 11:51 pm
Weather Station: Davis Vantage Pro 2
Operating System: Win 10
Location: Hot Springs, AR
Contact:

Re: Changing webtags for Saratoga AJAX gizmo time

Post by rlee171 »

Ken,

Works perfectly.... You made quick work of my hours of head scratching!

Many thanks
Post Reply