5,838
edits
m (→Use of spaces: Rewrite of last paragraph) |
m (→Use of spaces: Now rewritten whole section, as decided to add examples) |
||
Line 206: | Line 206: | ||
===Use of spaces=== | ===Use of spaces=== | ||
There are multiple | There are multiple symbols for specifying dates and times, and you might want spaces to appear between symbols in that output format. | ||
You need to add quotation marks to the output format specifier if spaces are present. | |||
A simple output format modifier, which only quotes valid time/date symbols but adds some spaces would have double quotes delimiting the specifier, the syntax is <code><#tag_name format="x y z"></code> and an example is '''<#TpressTH format="h:mm tt">'''. | |||
It becomes more complicated if we need to include other characters not to be interpreted by the date time parameter parser. Such literals are discussed fully in the [[#Including literals in format parameters]] sub-section later. Here it is just essential to say that if spaces and other literal text are wanted as well as valid date/time symbols, 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 '''<#TpressH format="\a't 'h:mm' ' tt' <small>on 'd/M/yyyy' </small>'">'''. | |||
Finally, the use of literals can cause you ''a problem if you want to use a date/time specification in a script'' because the script wants literal delimiters outside any web tags, so that delimiters remain when the web tag itself has been processed into a string by Cumulus. This means the type of quotes (single or double) used outside the web tag, cannot be used within the web tag. The complicated sounding (but actually simple solution) is to avoid placing literals, and/or spaces, within any output format specifier, instead put single quotes round the whole content. What you thought of putting as literals within any web tag is instead typed outside with separate web tags for the part of the specification before and after each literal. | |||
===Which tag names take date/time output formatting modifiers=== | ===Which tag names take date/time output formatting modifiers=== |
edits