Template:Years or months ago/testcases
Appearance
This is the template test cases page for the sandbox of Template:Years or months ago. to update the examples. If there are many examples of a complicated template, later ones may break due to limits in MediaWiki; see the HTML comment "NewPP limit report" in the rendered page. You can also use Special:ExpandTemplates to examine the results of template uses. You can test how this page looks in the different skins and parsers with these links: |
The following examples use December 2024 as the current month and year. If that is not correct, click purge to update the page.
Live template vs. Sandbox
[edit]Year and month
[edit]Parameters | Live template | Sandbox template | {{Start date and age}} | {{Time ago}} | {{Time ago}} min = months |
---|---|---|---|---|---|
Prior years | |||||
|2022|1
|
2 years ago | 2 years ago | January 2022 | 2 years ago | 2 years ago |
|2023|1
|
1 year ago | 1 year ago | January 2023 | 23 months ago | 23 months ago |
|2023|2
|
1 year ago | 1 year ago | February 2023 | 22 months ago | 22 months ago |
|2023|3
|
1 year ago | 1 year ago | March 2023 | 21 months ago | 21 months ago |
|2023|4
|
1 year ago | 1 year ago | April 2023 | 20 months ago | 20 months ago |
|2023|5
|
1 year ago | 1 year ago | May 2023 | 19 months ago | 19 months ago |
|2023|6
|
1 year ago | 1 year ago | June 2023 | 18 months ago | 18 months ago |
|2023|7
|
1 year ago | 1 year ago | July 2023 | 17 months ago | 17 months ago |
|2023|8
|
1 year ago | 1 year ago | August 2023 | 16 months ago | 16 months ago |
|2023|9
|
1 year ago | 1 year ago | September 2023 | 15 months ago | 15 months ago |
|2023|10
|
1 year ago | 1 year ago | October 2023 | 14 months ago | 14 months ago |
|2023|11
|
1 year ago | 1 year ago | November 2023 | 13 months ago | 13 months ago |
|2023|12
|
1 year ago | 1 year ago | December 2023 | 12 months ago | 12 months ago |
Current year | |||||
|2024|1
|
11 months ago | 11 months ago | January 2024 | 11 months ago | 11 months ago |
|2024|2
|
10 months ago | 10 months ago | February 2024 | 10 months ago | 10 months ago |
|2024|3
|
9 months ago | 9 months ago | March 2024 | 9 months ago | 9 months ago |
|2024|4
|
8 months ago | 8 months ago | April 2024 | 8 months ago | 8 months ago |
|2024|5
|
7 months ago | 7 months ago | May 2024 | 7 months ago | 7 months ago |
|2024|6
|
6 months ago | 6 months ago | June 2024 | 6 months ago | 6 months ago |
|2024|7
|
5 months ago | 5 months ago | July 2024 | 5 months ago | 5 months ago |
|2024|8
|
4 months ago | 4 months ago | August 2024 | 4 months ago | 4 months ago |
|2024|9
|
3 months ago | 3 months ago | September 2024 | 3 months ago | 3 months ago |
|2024|10
|
2 months ago | 2 months ago | October 2024 | 2 months ago | 2 months ago |
|2024|11
|
1 month ago | 1 month ago | November 2024 | 31 days ago | 1 month ago |
|2024|12
|
0 months ago | 0 months ago | December 2024 | 42 hours ago | 0 months ago |
Future years | |||||
|2025|1
|
1 month's time | 1 month hence | January 2025 | 29 days' time | 0 months' time |
|2025|2
|
2 months' time | 2 months hence | February 2025 | 60 days' time | 1 month's time |
|2025|3
|
3 months' time | 3 months hence | March 2025 | 2 months' time | 2 months' time |
|2025|4
|
4 months' time | 4 months hence | April 2025 | 3 months' time | 3 months' time |
|2025|5
|
5 months' time | 5 months hence | May 2025 | 4 months' time | 4 months' time |
|2025|6
|
6 months' time | 6 months hence | June 2025 | 5 months' time | 5 months' time |
|2025|7
|
7 months' time | 7 months hence | July 2025 | 6 months' time | 6 months' time |
|2025|8
|
8 months' time | 8 months hence | August 2025 | 7 months' time | 7 months' time |
|2025|9
|
9 months' time | 9 months hence | September 2025 | 8 months' time | 8 months' time |
|2025|10
|
10 months' time | 10 months hence | October 2025 | 9 months' time | 9 months' time |
|2025|11
|
11 months' time | 11 months hence | November 2025 | 10 months' time | 10 months' time |
|2025|12
|
1 year's time | 1 year hence | December 2025 | 11 months' time | 11 months' time |
|2026|12
|
2 years' time | 2 years hence | December 2026 | 23 months' time | 23 months' time |
Year only (no month)
[edit]Parameters | Live template | Sandbox template | {{Start date and age}} | {{Time ago}} | {{Time ago}} min = years |
---|---|---|---|---|---|
|2022
|
2 years ago | 2 years ago | 2022 | 2 years ago | 2 years ago |
|2023
|
1 year ago | 1 year ago | 2023 | 12 months ago | 1 year ago |
|2024
|
0 years ago | 0 years ago | 2024 | 18 hours ago | 0 years ago |
|2025
|
1 year's time | 1 year hence | 2025 | 12 months' time | 1 year's time |
|2026
|
2 years' time | 2 years hence | 2026 | 24 months' time | 2 years' time |
Non-breaking space
[edit]Test use of a non-breaking space between the number and the units (years, months, etc). A breaking space is used between the units and "ago" (similar to the output of Template:Time ago). These examples are placed inside a narrow <div> to force a line break.
Parameters | Live template | Sandbox template | {{Time ago}} |
---|---|---|---|
|2022
|
2 years ago
|
2 years ago
|
2 years ago
|
|2023
|
1 year ago
|
1 year ago
|
13 months ago
|
|2024|8
|
4 months ago
|
4 months ago
|
3 months ago
|
|2024|11
|
1 month ago
|
1 month ago
|
30 days ago
|
|2025|1
|
1 month's time
|
1 month hence
|
31 days' time
|
|2025|3
|
3 months' time
|
3 months hence
|
3 months' time
|
|2026
|
2 years' time
|
2 years hence
|
13 months' time
|
|2027
|
3 years' time
|
3 years hence
|
2 years' time
|
No parameters
[edit]Live template | Sandbox template |
---|---|
0 years ago | 0 years ago |
Live template vs. Template:Time ago (with min_magnitude)
[edit]Year and month
[edit]Template | Output | {{Time ago}} template | {{Time ago}} output |
---|---|---|---|
{{Years or months ago|2022|12}}
|
2 years ago | {{Time ago|2022-12|min_magnitude=months}}
|
2 years ago |
{{Years or months ago|2023|12}}
|
1 year ago | {{Time ago|2023-12|min_magnitude=months}}
|
12 months ago |
{{Years or months ago|2024|9}}
|
3 months ago | {{Time ago|2024-9|min_magnitude=months}}
|
3 months ago |
{{Years or months ago|2024|10}}
|
2 months ago | {{Time ago|2024-10|min_magnitude=months}}
|
2 months ago |
{{Years or months ago|2024|11}}
|
1 month ago | {{Time ago|2024-11|min_magnitude=months}}
|
1 month ago |
{{Years or months ago|2024|12}}
|
0 months ago | {{Time ago|2024-12|min_magnitude=months}}
|
0 months ago |
{{Years or months ago|2025|1}}
|
1 month's time | {{Time ago|2025-1|min_magnitude=months}}
|
Error: first parameter cannot be parsed as a date or time. |
{{Years or months ago|2026|2}}
|
1 year's time | {{Time ago|2026-2|min_magnitude=months}}
|
13 months' time |
{{Years or months ago|2025|12}}
|
1 year's time | {{Time ago|2025-12|min_magnitude=months}}
|
11 months' time |
{{Years or months ago|2026|12}}
|
2 years' time | {{Time ago|2026-12|min_magnitude=months}}
|
23 months' time |
Year only (no month)
[edit]Template | Output | {{Time ago}} template | {{Time ago}} output |
---|---|---|---|
{{Years or months ago|2022}}
|
2 years ago | {{Time ago|2022|min_magnitude=years}}
|
2 years ago |
{{Years or months ago|2023}}
|
1 year ago | {{Time ago|2023|min_magnitude=years}}
|
1 year ago |
{{Years or months ago|2024}}
|
0 years ago | {{Time ago|2024|min_magnitude=years}}
|
0 years ago |
{{Years or months ago|2025}}
|
1 year's time | {{Time ago|2025|min_magnitude=years}}
|
1 year's time |
{{Years or months ago|2026}}
|
2 years' time | {{Time ago|2026|min_magnitude=years}}
|
2 years' time |