Welcome to the Cumulus Support forum.
Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024
Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024
Legacy Cumulus 1 release v1.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
Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024
Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024
Legacy Cumulus 1 release v1.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
Formatting webtag <#daylightlength>
- krmidas
- Posts: 215
- Joined: Sat 03 Jul 2010 9:03 pm
- Weather Station: Davis Vantage Pro 2
- Operating System: Windows 10
- Location: Lake Zurich, IL; USA
- Contact:
Formatting webtag <#daylightlength>
The webtag <#daylightlength> returns a value of hh:mm. Is it possible to use any format parameters to separate hours and minutes?
In other words, to be able to show "15 hours, 12 minutes"? I don't think any of the format parameters apply to this situation, but I thought I'd ask.
-Tom
In other words, to be able to show "15 hours, 12 minutes"? I don't think any of the format parameters apply to this situation, but I thought I'd ask.
-Tom
- mcrossley
- Posts: 12695
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Bullseye Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: Formatting webtag <#daylightlength>
Good question, I don't know the answer, but I suspect you are right. I split the time in a little bit of script code to do exactly as you suggest on my home page.
- mcrossley
- Posts: 12695
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Bullseye Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: Formatting webtag <#daylightlength>
Code: Select all
<script>
var str = '<#daylightlength>'.split(':');
document.write(str[0] + ' hours ' + str[1] + 'minutes');
</script>
-
- Posts: 1255
- Joined: Mon 09 Jul 2012 8:40 pm
- Weather Station: Davis VP2 Cabled
- Operating System: Windows 10 Pro
- Location: Auckland, New Zealand
- Contact:
Re: Formatting webtag <#daylightlength>
This in a file named daylenT.txt;
daylen = "<#daylightlength format=hh> hours, <#daylightlength format=m> minutes"
produces this in a file named daylen.txt;
daylen = "10 hours, 12 minutes"
When I have Q's like this myself I just test the options.
Note:- hh or mm will include leading zero where h or m will not.
daylen = "<#daylightlength format=hh> hours, <#daylightlength format=m> minutes"
produces this in a file named daylen.txt;
daylen = "10 hours, 12 minutes"
When I have Q's like this myself I just test the options.
Note:- hh or mm will include leading zero where h or m will not.
- krmidas
- Posts: 215
- Joined: Sat 03 Jul 2010 9:03 pm
- Weather Station: Davis Vantage Pro 2
- Operating System: Windows 10
- Location: Lake Zurich, IL; USA
- Contact:
Re: Formatting webtag <#daylightlength>
I'll give it a try. My assumption was that those format parameters were for the time of day, not elapsed time.BCJKiwi wrote:This in a file named daylenT.txt;
daylen = "<#daylightlength format=hh> hours, <#daylightlength format=m> minutes"
produces this in a file named daylen.txt;
daylen = "10 hours, 12 minutes"
When I have Q's like this myself I just test the options.
Note:- hh or mm will include leading zero where h or m will not.
-
- Posts: 1255
- Joined: Mon 09 Jul 2012 8:40 pm
- Weather Station: Davis VP2 Cabled
- Operating System: Windows 10 Pro
- Location: Auckland, New Zealand
- Contact:
Re: Formatting webtag <#daylightlength>
The daylightlength tag produces a time value.
WIKI says "most time webtags will accept an option 'format' parameter", so, it should not be any different to any other time based tag.
Wiki gives an example;
<#TtempH format="'at' hh: mm 'on' dd / mm / yyyy">
However I have found the tags to be 'picky' when trying to get too complicated or to break up the base output into separate parts in one tag hence using the tag twice in my example.
So as I said, if the first format you try does not work then just try different options until one does.
WIKI says "most time webtags will accept an option 'format' parameter", so, it should not be any different to any other time based tag.
Wiki gives an example;
<#TtempH format="'at' hh: mm 'on' dd / mm / yyyy">
However I have found the tags to be 'picky' when trying to get too complicated or to break up the base output into separate parts in one tag hence using the tag twice in my example.
So as I said, if the first format you try does not work then just try different options until one does.
-
- Posts: 152
- Joined: Mon 03 Feb 2014 12:22 pm
- Weather Station: ws 2350
- Operating System: windows xp sp3
- Location: Europe
Re: Formatting webtag <#daylightlength>
I'm not sure that you can format all of webtags, but try this <#daylightlength format="hh 'hours' , mm 'minutes'">
- steve
- Cumulus Author
- Posts: 26702
- Joined: Mon 02 Jun 2008 6:49 pm
- Weather Station: None
- Operating System: None
- Location: Vienne, France
- Contact:
Re: Formatting webtag <#daylightlength>
<#daylightlength> has a format parameter; I don't think there are any date/time web tags currently which don't. Some of them may not work with the full range of formatters (e.g. they may only contain a time and not a date).
Steve
-
- Posts: 152
- Joined: Mon 03 Feb 2014 12:22 pm
- Weather Station: ws 2350
- Operating System: windows xp sp3
- Location: Europe
Re: Formatting webtag <#daylightlength>
OK than.......I've done a lot of formats, and I've never had a problem. I only took into consideration what is written: WIKI says "most time webtags will accept an option 'format' parameter"......
- krmidas
- Posts: 215
- Joined: Sat 03 Jul 2010 9:03 pm
- Weather Station: Davis Vantage Pro 2
- Operating System: Windows 10
- Location: Lake Zurich, IL; USA
- Contact:
Re: Formatting webtag <#daylightlength>
Thanks, all.
Using produced the desired result.
-Tom
Using
Code: Select all
<#daylength format=h> hrs <#daylength format=m> min
-Tom
- mcrossley
- Posts: 12695
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Bullseye Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: Formatting webtag <#daylightlength>
I should have taken a look at my own code
Code: Select all
$daylength='<#daylength format="hh'h 'nn'm'">';
$daylightlength='<#daylightlength format="hh'h 'nn'm'">';
- krmidas
- Posts: 215
- Joined: Sat 03 Jul 2010 9:03 pm
- Weather Station: Davis Vantage Pro 2
- Operating System: Windows 10
- Location: Lake Zurich, IL; USA
- Contact:
Re: Formatting webtag <#daylightlength>
I've noticed that the values being returned by <#daylength> and <#daylightlength> don't seem to be tracking with the values on the Cumulus screen. See the attached screenshots for today.
Here's the code I'm using to generate the values:
In fact, I don't think the values on my website have changed for those two webtags in the 5 days since I incorporated them. Any ideas?
-Tom
Here's the code I'm using to generate the values:
In fact, I don't think the values on my website have changed for those two webtags in the 5 days since I incorporated them. Any ideas?
-Tom
You do not have the required permissions to view the files attached to this post.
- steve
- Cumulus Author
- Posts: 26702
- Joined: Mon 02 Jun 2008 6:49 pm
- Weather Station: None
- Operating System: None
- Location: Vienne, France
- Contact:
Re: Formatting webtag <#daylightlength>
"n" is the formatter for "minutes", not "m", which is "months", except when it follows an "h" formatter - this is explained in the help. The value used for the web tag only contains a time, which is why the month is not 6, as you might expect.
Steve
- krmidas
- Posts: 215
- Joined: Sat 03 Jul 2010 9:03 pm
- Weather Station: Davis Vantage Pro 2
- Operating System: Windows 10
- Location: Lake Zurich, IL; USA
- Contact:
Re: Formatting webtag <#daylightlength>
Wow, don't know if I would have figured that out.
Thanks, as always! All fixed.
Thanks, as always! All fixed.