Template:Set news list/sandbox

From Yugipedia
< Template:Set news list
Revision as of 18:58, 20 July 2023 by Dinoguy1000 (talk | contribs) (robustify)
Jump to: navigation, search
  • April 25: [[{{{1}}}]]
Template documentation[view] [edit] [history] [purge]

{{Set news list}} formats set entries for display in {{News}} and on the main page.

Usage

This template accepts two unnamed parameters: the first for the unlinked set name, and the second for the date. The date must be provided in Month D, Year format (e.g. April 25, 2024; F j, Y in PHP's strtotime() format).

Current usage of this template is to format the output of a Semantic MediaWiki query, e.g. {{ #ask: [[Page type::Set page]] [[English release date::>{{ #time: Y-m-d | now - 15 days }}]] | ?English release date#-F[F j, Y] | link=none | format=template | template=Set news list | default = No known releases. }}. Note the #-F[F j, Y] result formatter on the ?English release date result; this is to correctly format the date for this template.

This template correctly handles dates with all of month, day, and year (returns Month Day for dates in this year, or Month Day, Year for dates in other years), dates with month and year (returns Month for dates in this year, or Month Year for dates in other years), and dates with only the year (always returns Year). Any date with a day but no month, or a day and/or month but no year, is considered invalid.

Code Result Notes
{{Set news list|Vol.1|February 4, 1999}}
  • ': [[{{{Name}}}]]
Full date, not current year
{{Set news list|Vol.1|February 1999}}
  • ': [[{{{Name}}}]]
Month+year, not current year
{{Set news list|Vol.1|February, 1999}}
  • ': [[{{{Name}}}]]
Month+year, separated by comma, not current year
{{Set news list|Vol.1|1999}}
  • ': [[{{{Name}}}]]
Year, not current year
{{Set news list|Vol.1|February 4, 2024}}
  • ': [[{{{Name}}}]]
Full date, current year
{{Set news list|Vol.1|February 2024}}
  • ': [[{{{Name}}}]]
Month+year, current year
{{Set news list|Vol.1|February, 2024}}
  • ': [[{{{Name}}}]]
Month+year, separated by comma, current year
{{Set news list|Vol.1|2024}}
  • ': [[{{{Name}}}]]
Year, current year
{{Set news list|Vol.1|4 February 1999}}
  • ': [[{{{Name}}}]]
Day Month Year input format is not supported
{{Set news list|Vol.1|February 4}}
  • ': [[{{{Name}}}]]
Nor are dates without a year
{{Set news list|Vol.1|4 February}}
  • ': [[{{{Name}}}]]
Not in Day Month format either
{{Set news list|Vol.1|1999-02-04}}
  • ': [[{{{Name}}}]]
ISO 8601 dates aren't supported either
{{Set news list|Vol.1|4, 1999}}
  • ': [[{{{Name}}}]]
Dates with a day but no month also aren't supported

See also