Webtags/Parameters (preserving history): Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
m
no edit summary
m (typos)
mNo edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 138: Line 138:
Your options are described under the following subheadings:
Your options are described under the following subheadings:
* [[#Rounding to a specific number of decimal places]]
* [[#Rounding to a specific number of decimal places]]
* [[Multiple Output Format Modifier parameters for times and dates]]
* [[#Multiple Output Format Modifier parameters for times and dates]]


===Additional output modification parameters that are only available for MX users===
===Additional output modification parameters that are only available for MX users===
Line 276: Line 276:
|-
|-
! scope="row"| [[Webtags#Today]], [[Webtags#Yesterday]]
! scope="row"| [[Webtags#Today]], [[Webtags#Yesterday]]
| Any tag name in "Time" column of linked table
| Each tag name in "Time" column of linked table has limited (see ~ below the table) ability to modify output format
| None
| None
| None
| None
|-
|-
! scope="row"| [[Webtags#Monthly]], [[Webtags#Yearly]]
! scope="row"| [[Webtags#Monthly]], [[Webtags#Yearly]]
| Those tag names in  "Time" column of linked table in first column that represent spot value extreme records. For notes see ~ below this table
| Those tag names in  "Time" column of linked table in first column that represent spot value extreme records. For rainfall tag notes see ‡ below this table
| Any tag name in "Date" column of linked table in first column that represent either daily extremes or spot value extreme records. For notes see † below this table
| Each tag name in "Date" column of linked table in first column that represent either daily extremes or spot value extreme records. For notes see † below this table
| None of the tag names. For explanation see the ^ below this table
| None of the tag names. For explanation see the ^ below this table
|-
|-
! scope="row"| [[Webtags#All_Time]], [[Webtags#Monthly_All_Time_Records]]
! scope="row"| [[Webtags#All_Time]], [[Webtags#Monthly_All_Time_Records]]
| None (all tag names combine both time and date)
| None (all tag names combine both time and date)
| Those tag names in "Date/Time" column of linked table that represent daily extremes
| Those tag names in "Date/Time" column of linked table that represent daily extremes contain only dates
| Those tag names in "Date/Time" column of linked table that represent spot value extreme records
| Those tag names in "Date/Time" column of linked table that represent spot value extreme records contain both date and time in single tag name
|-
|-
! scope="row"| [[Webtags#Davis]]
! scope="row"| [[Webtags#Davis]]
Line 295: Line 295:
| None
| None
|}
|}
~  For rainfall, only '''<#LastRainTip>''' can have output modifiers added to report a clock time.
'''NOTES:'''
&dagger; Daily extremes (e.g. wettest day <#MonthDailyRainHD>, and temperature ranges <#MonthHighDailyTempRangeD>) have no time tag.
 
~ Can choose from Hour/Minute format options, no seconds resolution available in these tags<br>
&Dagger; For rainfall, only one tag '''<#LastRainTip>''' can have output modifiers added to report a clock time (to nearest minute, seconds not available).<br>
&dagger; Daily extremes (e.g. wettest day <#MonthDailyRainHD>, and temperature ranges <#MonthHighDailyTempRangeD>) have no time tag.<br>
^ For the monthly and yearly web tags, the date and time are in separate tag names. It is not possible to get both time and date out of either tag name.
^ For the monthly and yearly web tags, the date and time are in separate tag names. It is not possible to get both time and date out of either tag name.


Line 713: Line 716:
|}
|}


===Use of spaces===
=== Literals in scripts===


If you are considering use of literals (such as a space) within a output format modifier in a script, then don't. Instead include whatever precedes the literal in a tag specification, then concatenate on the literal, and finally concatenate another tag specification for whatever is to follow the literal.  An example to make this clearer is <code>$MXDateTime = '<#date format=yyyy-MM-dd>' . 'T' . '<#time format=hh:mm:ss>';</code>, which is written in PHP Hypertext Pre-processor format, the literal 'T' has been inserted by using two separate web tags surrounding the literal.  The same approach applies if you wanted to replace that "T" with a space.  (The explanation is that Cumulus (1 and MX) requires single quotes round a literal, but the script language requires any string to be enclosed in quotes, and double quotes are required by Cumulus round any complex specifier including any that include a space or other literal).
If you are considering use of literals (such as a space) within a output format modifier in a script, then don't. Instead include whatever precedes the literal in a tag specification, then concatenate on the literal, and finally concatenate another tag specification for whatever is to follow the literal.  An example to make this clearer is <code>$MXDateTime = '<#date format=yyyy-MM-dd>' . 'T' . '<#time format=hh:mm:ss>';</code>, which is written in PHP Hypertext Pre-processor format, the literal 'T' has been inserted by using two separate web tags surrounding the literal.  The same approach applies if you wanted to replace that "T" with a space.  (The explanation is that Cumulus (1 and MX) requires single quotes round a literal, but the script language requires any string to be enclosed in quotes, and double quotes are required by Cumulus round any complex specifier including any that include a space or other literal).
===Use of spaces===


[[File:Badge vMx.png]]The first complication is that the parser that interprets time/date characters has two ways of interpreting a space character, depending on what immediately follows.  In the tables, below, I have used a "%" in various places. In any of those places with a "%", you can insert a space instead,  understanding that space is not a gap between format characters, but simply an alternative to "%" as a special character.  To explain the two ways of interpreting spaces consider as an example '''<#TpressTH format=" h:mm tt">'''. In that example the two spaces are interpreted in two different ways! The "space" before "h" is treated as the same as "%", but as the ''mm'' and ''tt'' are multi-character symbols, that does insert a space after the minutes but before the am/pm. I discuss this later in [[#Migrating from legacy Cumulus 1 to MX]] section.
[[File:Badge vMx.png]]The first complication is that the parser that interprets time/date characters has two ways of interpreting a space character, depending on what immediately follows.  In the tables, below, I have used a "%" in various places. In any of those places with a "%", you can insert a space instead,  understanding that space is not a gap between format characters, but simply an alternative to "%" as a special character.  To explain the two ways of interpreting spaces consider as an example '''<#TpressTH format=" h:mm tt">'''. In that example the two spaces are interpreted in two different ways! The "space" before "h" is treated as the same as "%", but as the ''mm'' and ''tt'' are multi-character symbols, that does insert a space after the minutes but before the am/pm. I discuss this later in [[#Migrating from legacy Cumulus 1 to MX]] section.
Line 728: Line 733:


Literals are discussed fully in the [[#Including literals in format parameters]] sub-section later. If we want to include other characters not to be interpreted by the date time parameter parser, and spaces, then both double and single quotes must be used, and the spaces must be within the single quotes.  An example, that shows all the options that MX allows, with literals is <code> <#TpressH format="\a't 'h:mm'&nbsp;' tt' <nowiki><small>on 'd/M/yyyy' </small></nowiki>'"> </code>.
Literals are discussed fully in the [[#Including literals in format parameters]] sub-section later. If we want to include other characters not to be interpreted by the date time parameter parser, and spaces, then both double and single quotes must be used, and the spaces must be within the single quotes.  An example, that shows all the options that MX allows, with literals is <code> <#TpressH format="\a't 'h:mm'&nbsp;' tt' <nowiki><small>on 'd/M/yyyy' </small></nowiki>'"> </code>.


=Some Extra Information=
=Some Extra Information=

Navigation menu