Difference between revisions of "Template:DECADE/doc"

From blackwiki
Jump to navigation Jump to search
(Added a few more examples (like 2017 is the 2010s))
imported>Tom.Reding
m (Proper sections at the same level as == See also == etc.)
Line 3: Line 3:
 
This template computes the decade for the Gregorian year in parameter.
 
This template computes the decade for the Gregorian year in parameter.
  
; Syntax<nowiki>:</nowiki>
+
=== Syntax ===
 
: <kbd><nowiki>{{</nowiki>DECADE|</kbd>''year''<kbd>}}</kbd>
 
: <kbd><nowiki>{{</nowiki>DECADE|</kbd>''year''<kbd>}}</kbd>
 
* The ''year'' must be astronomical (''year''=1 in [[1 AD]] (''[[Anno Domini]]''), ''year''=0 in 1 BC, ''year''=-1 in 2 BC).
 
* The ''year'' must be astronomical (''year''=1 in [[1 AD]] (''[[Anno Domini]]''), ''year''=0 in 1 BC, ''year''=-1 in 2 BC).
  
; Examples<nowiki>:</nowiki>
+
=== Examples ===
 
: <kbd><nowiki>{{DECADE|1738}}</nowiki></kbd> returns {{DECADE|1738}}
 
: <kbd><nowiki>{{DECADE|1738}}</nowiki></kbd> returns {{DECADE|1738}}
 
: <kbd><nowiki>{{DECADE|1899}}</nowiki></kbd> returns {{DECADE|1899}}
 
: <kbd><nowiki>{{DECADE|1899}}</nowiki></kbd> returns {{DECADE|1899}}
Line 22: Line 22:
 
: <kbd><nowiki>{{DECADE|2101}}</nowiki></kbd> returns {{DECADE|2101}}
 
: <kbd><nowiki>{{DECADE|2101}}</nowiki></kbd> returns {{DECADE|2101}}
  
; See also<nowiki>:</nowiki>
+
=== See also ===
 
: [[Template:MILLENNIUM]]
 
: [[Template:MILLENNIUM]]
 
: [[Template:CENTURY]]
 
: [[Template:CENTURY]]

Revision as of 12:00, 7 June 2019

This template computes the decade for the Gregorian year in parameter.

Syntax

{{DECADE|year}}
  • The year must be astronomical (year=1 in 1 AD (Anno Domini), year=0 in 1 BC, year=-1 in 2 BC).

Examples

{{DECADE|1738}} returns 1730s
{{DECADE|1899}} returns 1890s
{{DECADE|1900}} returns 1900s
{{DECADE|1901}} returns 1900s
{{DECADE|1915}} returns 1910s
{{DECADE|1962}} returns 1960s
{{DECADE|1999}} returns 1990s
{{DECADE|2000}} returns 2000s
{{DECADE|2001}} returns 2000s
{{DECADE|2017}} returns 2010s
{{DECADE|2099}} returns 2090s
{{DECADE|2100}} returns 2100s
{{DECADE|2101}} returns 2100s

See also

Template:MILLENNIUM
Template:CENTURY
Template:YEARCC
Template:YEARYY
Template:MONTHDAYS
Template:IsLeapYear
Template:JULIANDAY
Template:WEEKDAY