Template:Day-1/doc
Appearance
| This is a documentation subpage for Template:Day-1. It may contain usage information, categories and other content that is not part of the original template page. |
| This template is used on approximately 8,300 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
{{day-1}} subtracts one from a date or date-specific pagename
Usage
{{Day-1}} - returns yesterday's date
{{Day-1|date}} - returns the day before the 'date' passed
{{Day-1|date|pagename|year|spacingchar}} - returns the name of the page one day before the 'datepage' passed in
- Example
| Code | Result |
|---|---|
{{Day-1}}
|
October 9 |
{{Day-1|January 1}}
|
January 2 |
{{Day-1|January 1||2004}}
|
January 2, 2004 |
{{Day-1|January 1, 2004||2004}}
|
January 2, 2003 |
{{Day-1|January 1, 2004||2004|_}}
|
January_2,_2004 |
{{Day-1|February 28}}
|
March 1 |
{{Day-1|February 28|Wikipedia:Today's featured article/|2004}}
|
Wikipedia:Today's featured article/March 1, 2004 |
{{Day-1|March 1}}
|
March 2 |
{{Day-1|March 1||2004}}
|
March 2, 2004 |
{{Day-1|March 1, 2004}}
|
March 2 |
{{Day-1|March 1, 2005}}
|
March 2 |
{{day-1|{{day-1}}}}
|
October 10 |
{{day-1|{{Currentmonthday}}|Wikipedia:Today's featured article/|{{CURRENTYEAR}}}}
|
Wikipedia:Today's featured article/October 9, 2026 |
''[http://en.wikipedia.org/w/wiki.phtml?title=Wikipedia:POTD_row/{{day-1|4=_}},_{{CURRENTYEAR}}&action=edit Edit]''
|
Edit |
TemplateData
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Day-1 in articles based on its TemplateData.
TemplateData for Day-1
Returns the date of yesterday or the previous day of some specified date.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| date | 1 | A specific date to calculate the previous day, as understood by {{#time}}
| String | optional |
| page name | 2 | A prefix to prepend before the returned date
| String | deprecated |
| year | 3 | Include (or repeat) the year to return an MDY date; omit to return just an MD date
| String | optional |
| spacing char | 4 | Separator to replace the spaces in the returned date
| String | deprecated |
| days | days | no description
| Number | deprecated |
See also
Multiple units of time
| Type | Adjustable | Current | Last | Next |
|---|---|---|---|---|
| Date and time |
|
|
||
| Date only | ||||
| Month and year only |
|
| ||
| Time only |
|
|
||
| Banners |
|
|||
| Timestamp |
|
Single units of time
| Unit of time | Adjustable | Current | Last | Next |
|---|---|---|---|---|
| Second |
|
|||
| Minute |
|
|||
| Hour |
|
|||
| Week |
|
|||
| Day of Week |
|
|
||
| Month |
|
|
|
|
| Day of Month |
|
|||
| Year |
|
|
| |
| Day of Year |
|
|||
| Decade |
|
|
||
| Century |
|
|
||
| Millenium |
|
Date and time templates made for substitution
Parser functions
- mw:Special:MyLanguage/time permits a custom time specifier string, similar to the C date and time functions
Individual templates
- {{Calendar}}
- {{Calendar clock with Wikipedia stats}}
- {{Clock}}
- {{Digital clock}}
- {{Digital clock and date}}
- {{Infobox calendar date today}}
Categories of templates
- Category:Time, date and calendar templates
- Category:Date-computing templates
- Category:Date-computing templates based on current time
- Category:ISO date templates
- Category:Calendar templates