Webtags (preserving history): Difference between revisions

m
→‎Time/Date 'format' Parameter: use of HTML tags within text
m (→‎Recent History: build 1088 change added to 'recent wind gust')
m (→‎Time/Date 'format' Parameter: use of HTML tags within text)
Line 18: Line 18:
=Time/Date 'format' Parameter=
=Time/Date 'format' Parameter=


From 1.9.1 most time webtags will accept an option 'format' parameter, e.g: <#YearTempHT format=hh:nn>. This allows you to override the default display format for that item, using the format specifiers in the table below. Note that if your format has any spaces in it, you must enclose it in double quotes, thus: <#YearTempHT format="hh nn">. Note also that you can specify date formatting to times and vice versa, but this will not always yield a sensible result.
From 1.9.1 most time webtags will accept an option 'format' parameter, e.g: <#YearTempHT format=hh:nn>. This allows you to override the default display format for that item, using the format specifiers in the table below. Note that if your format has any spaces in it, you must enclose it in double quotes, thus: <#YearTempHT format="hh nn">.  


You should put anything which is not intended to be part of the date and time formatting into single quotation marks to prevent it being interpreted as a date or time formatter. For example, the word "on" contains the character "n", which will be interpreted as a time formatter unless you put it into single quotation marks. Example: <#TtempH format="'at' hh: mm 'on' dd / mm / yyyy">
Although in theory you can specify date formatting to times and vice versa, this will not always yield a sensible result. It is best to look at the default format. For example the time-stamps for today and yesterday only contain time information, so only time-based format instructions should be applied to them.
 
You should put anything which is not intended to be part of the date and time formatting into single quotation marks to prevent it being interpreted as a date or time formatter. For example, the word "on" contains the character "n", which will be interpreted as a time formatter unless you put it into single quotation marks. Example: <#TtempH format="'at' hh: mm 'on' dd / mm / yyyy">.  You can include HTML tags (but they cannot have any attributes because both single and double quote characters have defined meanings) and special characters as quoted text within the 'format' parameter.  Example: <#TapptempH format="'at 'h:nn'&nbsp;'am/pm '<small>on' d/m/yyyy'</small>'">.


{| class="wikitable" border="1"
{| class="wikitable" border="1"
5,838

edits