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
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
Help with web tag date/time format
- mcrossley
- Posts: 14388
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Bullseye Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Help with web tag date/time format
I may be missing something here, but how can you incorporate a quotation mark - single or double - in a web tag date/time format string?
I have tried...
<#tag format="dd mmm yyyy' <"quoted_string"> 'hh:nn">
but the parser stops at the second double quote even though it is inside single quotes: "12 Jan 2014 <"
I tried double single quotes...
<#tag format="dd mmm yyyy' <''quoted_string''> 'hh:nn">
But the ignores the singles completely (obvious really, they simple close and re-open the 'string'): "12 Jan 2014 <quoted_string> 12:34"
I tried a backslash escape...
<#tag format="dd mmm yyyy' <\"quoted_string\"> 'hh:nn">
That drives the parser mad, I get all sorts of garbage out.
I know I can do this by using the tag twice, but is there a way of doing it one hit?
I have tried...
<#tag format="dd mmm yyyy' <"quoted_string"> 'hh:nn">
but the parser stops at the second double quote even though it is inside single quotes: "12 Jan 2014 <"
I tried double single quotes...
<#tag format="dd mmm yyyy' <''quoted_string''> 'hh:nn">
But the ignores the singles completely (obvious really, they simple close and re-open the 'string'): "12 Jan 2014 <quoted_string> 12:34"
I tried a backslash escape...
<#tag format="dd mmm yyyy' <\"quoted_string\"> 'hh:nn">
That drives the parser mad, I get all sorts of garbage out.
I know I can do this by using the tag twice, but is there a way of doing it one hit?
- beteljuice
- Posts: 3292
- Joined: Tue 09 Dec 2008 1:37 pm
- Weather Station: None !
- Operating System: W10 - Threadripper 16core, etc
- Location: Dudley, West Midlands, UK
Re: Help with web tag date/time format
Why do you need < and > ?
<#tag format="dd mmm yyyy 'unquoted_string' hh:nn">
<#tag format="dd mmm yyyy 'unquoted_string' hh:nn">
......................Imagine, what you will KNOW tomorrow !
- steve
- Cumulus Author
- Posts: 26672
- Joined: Mon 02 Jun 2008 6:49 pm
- Weather Station: None
- Operating System: None
- Location: Vienne, France
- Contact:
Re: Help with web tag date/time format
The normal way to put quotes in a string in Delphi is to repeat the quote symbol to escape it, but because web tags are a mix of HTML and Delphi string processing, I don't think this will work. Can you not just use " and ' as you would usually in HTML in situations like this?
Steve
- mcrossley
- Posts: 14388
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Bullseye Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: Help with web tag date/time format
Hmm, Steve the " method won't work. Betelejuice, I was trying to simply the format string... What I was trying to do was embed some HTML into the format string, ending up with a string like this...
'01 Jan 1900<span class="class_name"> at 01:23</span>'
You can probably see how that could be used.
'01 Jan 1900<span class="class_name"> at 01:23</span>'
You can probably see how that could be used.
- steve
- Cumulus Author
- Posts: 26672
- Joined: Mon 02 Jun 2008 6:49 pm
- Weather Station: None
- Operating System: None
- Location: Vienne, France
- Contact:
Re: Help with web tag date/time format
Yes, I see the problem if what you're trying to create is HTML. I think that there are too many language/protocol/conversion levels in the way for 'raw' quote characters to get handled properly inside the format parameter of a web tag.mcrossley wrote:Hmm, Steve the " method won't work.
The new version of Cumulus has to have web tag 'escaping' done differently, which is going to require people to change their format parameters, unfortunately, but it does mean that what you're trying to do here will work.
Steve
- beteljuice
- Posts: 3292
- Joined: Tue 09 Dec 2008 1:37 pm
- Weather Station: None !
- Operating System: W10 - Threadripper 16core, etc
- Location: Dudley, West Midlands, UK
Re: Help with web tag date/time format
If 'escaped' coding won't work, you'll have to format the <#webtag> twice ...
<#tag format="dd mmm yyyy"> <span class="class_name"><#tag format="hh:nn"></span>
<#tag format="dd mmm yyyy"> <span class="class_name"><#tag format="hh:nn"></span>
......................Imagine, what you will KNOW tomorrow !
- mcrossley
- Posts: 14388
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Bullseye Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: Help with web tag date/time format
Opps, forgot to press Submit on this, so yes beteljuice this is what I have done...
Ah well, I guess I'll have to use a construct like...
'<#ByMonthTempHT mon=1 format="dd' 'mmm' 'yyyy"><span class="class_name"><#ByMonthTempHT mon=1 format=" 'at' hh:nn"></span>'
Only 216 times for the monthly records!
Ah well, I guess I'll have to use a construct like...
'<#ByMonthTempHT mon=1 format="dd' 'mmm' 'yyyy"><span class="class_name"><#ByMonthTempHT mon=1 format=" 'at' hh:nn"></span>'
Only 216 times for the monthly records!
- beteljuice
- Posts: 3292
- Joined: Tue 09 Dec 2008 1:37 pm
- Weather Station: None !
- Operating System: W10 - Threadripper 16core, etc
- Location: Dudley, West Midlands, UK
Re: Help with web tag date/time format
You shouldn't need ' ' - a small saving ....
......................Imagine, what you will KNOW tomorrow !
- mcrossley
- Posts: 14388
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Bullseye Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: Help with web tag date/time format
You're right, I needed it before to stop the line splitting mid way through the date, now it is shorter on mobile devices it should not break anyway.
Got the monthly and all time records pages displaying better on my phone now, no line wrapping, but you lose the time and full spellings of Maximum/Minimum -> Max Min. Works for me
Got the monthly and all time records pages displaying better on my phone now, no line wrapping, but you lose the time and full spellings of Maximum/Minimum -> Max Min. Works for me
-
sfws
- Posts: 1183
- Joined: Fri 27 Jul 2012 11:29 am
- Weather Station: Chas O, Maplin N96FY, N25FR
- Operating System: rPi 3B+ with Buster (full)
Re: Help with web tag date/time format
Mark
You've done your 216 times typing now, but I did not pick this up when you posted the question.
It occurs to me that you did not need to type in multiple times, as you could simply have used in CSS the selector
with any required definition as per that class. Or you could define a class at table level and prefix the selector with the class. The point is that Cumulus permits a HTML tag within the format and that can be used as the basis of changing the look for that part of the format.
I use the following construct on one of my (not online) web pages, so the date is shorter as my chosen format for the time is longer. (My reason for using that time format is that some cells like those for total rain have the rollover time web tag in them and as that outputs '9am' for me I wanted all times to be consistent). If I was putting my web page online, I could redefine that small within td to hide it for mobiles.
You've done your 216 times typing now, but I did not pick this up when you posted the question.
It occurs to me that you did not need to type in
Code: Select all
class="not-mobile"Code: Select all
td span{ }I use the following
Code: Select all
<td><#apptempH> <#tempunit> <#TapptempH format="'at 'h:nn' 'am/pm '<small>on' d/m/yyyy'</small>'"></td>- mcrossley
- Posts: 14388
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Bullseye Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: Help with web tag date/time format
Thanks, yes that would be a better way of doing it, I may revisit this when I have time, but for now the power of regex and Sublime edit has got me going.