Template:Year article header: Difference between revisions
No edit summary |
OwenBlacker (talk | contribs) |
||
(57 intermediate revisions by 25 users not shown) | |||
Line 1: | Line 1: | ||
<includeonly>'''{{{1|{{CURRENTYEAR}}}}}''' {{#ifeq:{{#expr:{{{1|{{CURRENTYEAR}}}}}>=0}}|1|([[Roman numerals|{{Roman|{{{1|{{CURRENTYEAR}}}}}|Roman numeral out of range}}]])|}} {{#ifeq: {{#expr:{{{1|{{CURRENTYEAR}}}}}>1582}}|0 |
|||
⚫ | |||
These notes and instructions only appear to people reading the template directly, when it is used you do not see this. |
|||
Note: This template is good enough to use on years after 1929. If you are planning to work on it to fix the issue of Julian display for years 1600 through 1929, it would be nice if you contact me, I might be able to help. [[User:Rfc1394|Paul Robinson (Rfc1394)]] ([[User talk:Rfc1394|talk]]) 20:25, 29 July 2013 (UTC) |
|||
==Instructions== |
|||
The purpose of this template is to create a standard, uniform calendar description as the first sentence for all years, at least from 1600 on, with links to the appropriate terms. Currently, it works fine for 1930 and later; the Julian calculations need a bit of work. It's designed to say the year as either being "was" the year if it is before this year, "is" this year if it's the current year, and "will be" the year if it's after this year, e.g. in 2012, years 2011 and before would say "2011 was a common year starting on..." "2012 is a leap year starting on..., and is the current year" "2013 will be a common year starting on..." |
|||
Yes, it does know that only century years which are divisible by 400 are leap years. |
|||
Also, leave the space between "millenium" and the comma, it's a mnemonic to remind me it's a template and I need to fix (1) the before 1930 issue, and (2)add the letter representing leap year/exeptional/common year on day of week year starts in calcluations. (See the source code for 1997 for details where it's missing.) |
|||
==Usage== |
|||
'''<nowiki>{{</nowiki>Year article header|year it covers}}''' as the first item in the text of a year, e.g. |
|||
'''<nowiki>{{</nowiki>Year article header|2092}}''' for the article for that year. |
|||
==Note to editors== |
|||
With very limited exceptions, because of bugs in PHP, this will probably not work before 1600. It currently does work perfectly for years after 1929 (1930 and later stopped using Julian Calendars; the Julian calculations need a bit more work). Years before 1582 show Julian and prospective Gregorian. 1582 shows Julian plus warning and prospective Gregorian, 1583 and later, Gregorian with Julian and number of days off for years below 1930, Gregorian only after 1929. |
|||
</noinclude><includeonly> |
|||
'''{{{1}}} ([[Roman numerals|{{#time:xrY|{{{1}}}-01-01}}]])''' |
|||
{{#ifeq: {{#expr:{{{1}}}>1582}}|0 |
|||
|<!-- Years On or Before 1582 --> |
|<!-- Years On or Before 1582 --> |
||
{{#ifeq: {{#expr:{{{1}}}=1582}}|0 |
{{#ifeq: {{#expr:{{{1|{{CURRENTYEAR}}}}}=1582}}|0 |
||
|<!-- Years Before 1582 --> |
|<!-- Years Before 1582 -->was {{Year article header/zc|{{{1|{{CURRENTYEAR}}}}}}}. As of the start of {{Year article header/Julian day|{{{1|{{CURRENTYEAR}}}}}}}, which was the dominant calendar of the time. |
||
|<!-- In 1582 --> |
|<!-- In 1582 --> |
||
<!--Text for the year 1582 --> |
<!--Text for the year 1582 -->was {{Year article header/zc|1582}}. As of the start of {{Year article header/Julian day|{{{1|{{CURRENTYEAR}}}}}}}, which had previously been the universally accepted calendar in Christian nations. However, this year saw the beginning of the '''''Gregorian Calendar switch''''', when the [[Papal bull]] known as {{lang|la|[[Inter gravissimas]]}} introduced the [[Gregorian calendar]], adopted by Spain, Portugal, the [[Polish–Lithuanian Commonwealth]] and most of present-day Italy from the start. In these countries, the year continued as normal until Thursday, [[October 4]]. However, the next day became Friday, [[October 15]] (like a [[common year starting on Friday]]), in those countries (France followed two months later, letting Sunday, [[December 9]] be followed by Monday, [[December 20]]). Other countries continued using the Julian calendar for decades or, in some cases, centuries.}}|<!-- Years On or After 1582 --> |
||
{{#ifeq: {{#expr:{{{1}}}> |
{{#ifeq: {{#expr:{{{1|{{CURRENTYEAR}}}}}>1923}}|0 |
||
|<!-- Years 1583 through |
|<!-- Years 1583 through 1923 --> |
||
{{#ifeq: {{#expr:{{{1}}}= |
{{#ifeq: {{#expr:{{{1|{{CURRENTYEAR}}}}}=1923}}|0 |
||
|<!-- Before |
|<!-- Before 1923 -->was {{Year article header/zc|{{{1|{{CURRENTYEAR}}}}}}}. As of the start of {{Year article header/Julian day|{{{1|{{CURRENTYEAR}}}}}}}, which remained in localized use until 1923. |
||
|<!-- |
|<!-- 1923 was a [[Common year starting on Monday]] -->was {{Year article header/zc|1923}}. As of the start of {{Year article header/Julian day|{{{1|{{CURRENTYEAR}}}}}}}, which was relegated that February to use only by churches after [[Greece]] adopted the Gregorian calendar.}} |
||
⚫ | |||
}} |
|||
⚫ | |||
⚫ | |||
}}}} {{main other|{{Short description|Calendar year|noreplace}}}} </includeonly><noinclude>{{Short description|A template to set up a consistent opening paragraph for most years }} |
|||
⚫ | |||
{{Documentation}} |
|||
}}}}</includeonly> |
|||
⚫ |
Latest revision as of 22:15, 6 November 2024
This template adds an automatically generated short description. If the automatic short description is not optimal, replace it by adding {{Short description}} at the top of the article. |
These notes and instructions only appear to people reading the template directly; when it is used, you do not see this.
Instructions
The purpose of this template is to create a standard, uniform calendar description as the first sentence for all years from 1582 on with links to the appropriate terms. It's designed to say the year as either being "was" the year if it is before this year, "is" this year if it's the current year, and "will be" the year if it's after this year, e.g. in 2012, years 2011 and before would say "2011 was a common year starting on..." "2012 is the current year, and is a leap year starting on..." "2013 will be a common year starting on..."
Yes, it does know that only century years which are divisible by 400 are leap years.
Suppose that y is the current year. Then for year y+1, it will say "will be a", then in year y+1, it will say "is the current year, and is a", and finally in year y+2, it will say "was a".
The nice thing about this is that because it's all generated programmatically, when the current year changes it makes the change automatically without requiring human intervention.
Usage
{{Year article header|year it covers}} as the first item in the text of a year, e.g. {{Year article header|2092}} for the article for that year. Note that inserting the year directly as opposed to using {{PAGENAME}} was intentional; I needed to make calculations on the value passed and I wanted to make sure I could do that, plus I couldn't test the template if I used the PAGENAME parameter.
If not supplied an argument, {{Year article header}} defaults its first parameter to {{CURRENTYEAR}}
.
Note to editors
It currently does work perfectly for years after 1582. Years before 1582 show Julian and proleptic Gregorian. 1582 shows Julian plus warning and proleptic Gregorian, 1583 and later, Gregorian with Julian and number of days off for years below 1924, Gregorian only after 1923.
Template data
TemplateData for Year article header
This template creates an introduction to an article about a year.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Year | 1 | The year to create an introduction for.
| Number | required |