Template:Dm

From OpenStreetMap Wiki
Jump to: navigation, search
20 Oct.
[Edit] [Octicons-sync.svgpurge] Template-info.svg Template documentation

Usage

{{Dm|date}}
{{Dm|begin|end}}

This template displays the day and month of the date argument or arguments in the language deduced from the page’s name. The date can be entered in any format that Mediawiki’s #time function understands, but usually omits the year. In this case, the current year is assumed, which may fail to render correctly some dates falling on 29 February, but not in the current year, for example in archived calendar events or events scheduled in the future (if this occurs, specify explicitly the year in the date parameters, even if this year will not be displayed).

Extended usage with the optional parameter specifying a year

{{Dm|y=year|date}}
{{Dm|y=year|begin|end}}

This overrrides the default current year assumed by default by Mediawiki’s #time function when parsing the given date values.

This indication of the year (not displayed) also enables the insertion of invisible microformats for each date (in standard ISO 8601 format YYYY-MM-DD), usable by external parsers (such as pin13.net/mf2 for parsing Template:Calendar and generate JSON data) for creating custom calendars. This first assumes that both dates (when specifying a date range) will be on the same specified year:

  • this is true when the first specified month and day (in the current year) comes before the second specified month and day (in the current year);
  • otherwise the first date will be in the specified year, the second date will be the next year (there's no support to allow date ranges spannig more than twelve months).

No indication of time is given: as the default time is at start of the day (at 00:00 UTC), the second date given in date ranges will be converted in the generated microformat at start of the following day (at 00:00 UTC).

See also