Difference between revisions of "Template:DateUnpackB"
Jump to navigation
Jump to search
(21 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly>;Date Released :[[:Category:{{{yr}}} Movies{{!}}{{{yr}}}]] | <includeonly>{{#switch:{{#len:{{{yr}}}}} | ||
|4={{DateB Year Released|{{{yr}}}}} | |||
|2=<noinclude>length is two digits but not "19" | |||
</noinclude>{{#ifeq: {{{yr}}} | 19 | ;Date Released :possibly 1919 [[Category:Error Year is 19]] | {{DateB Year Released|19{{{yr}}}}}}} | |||
|5|6|7|8|9=;Date Released | |||
:{{#switch:{{#count:{{{yr}}}|19}}|0= '''error:''' "19" not found in year | |||
|1=:[[:Category:19{{#sub:{{#explode:{{{yr}}}|19|-1}}|0|2}} Movies{{!}}~19{{#sub:{{#explode:{{{yr}}}|19|-1}}|0|2}}]][[Category:19{{#sub:{{#explode:{{{yr}}}|19|-1}}|0|2}} Movies]] | |||
:<small class="debugData">Year ~19{{#sub:{{#explode:{{{yr}}}|19|-1}}|0|2}} derived via [[Template:DateUnpackB|UnpackB Tpl]].</small> | |||
|error "19" found more than once in year}} | |||
|1=[[Category: Zero Year]] | |||
|3= '''error:''' year is only 3 characters; should be 4 chars like "1950" (year, not decade) [[Category: Zero Year]] | |||
|0=[[Category: Zero Year]] | |||
| '''error:''' year (date?) is 10 or more characters; should be 4 chars like "1950" <!-- end yrB switch --> }}</includeonly><noinclude> | |||
{{Documentation}} | {{Documentation}} | ||
</noinclude> | </noinclude> |
Latest revision as of 20:30, 15 March 2022
- - -
There is a documentation subpage housing the metadata about parent template: DateUnpackB.
Description
This outputs the definition "infobox" version of release date.
Semi smart
This template assumes a four digit date starting with 19. If it doesn't get that, it makes a bunch of other assumptions that maybe wrong.
Condition | Result |
---|---|
yr is len 0 | display No Yr Cat |
yr is len 1 | display No Yr Cat |
len 2 | If yr is 2 long, Assume numbers, prepend "19" |
len 3 | error |
len 4 | Assume numbers, no spc handling needed |
len > 9 | error |
TODO
Add regex to ensure that only numbers are passed to Template:DateB Year Released
Examples
output example
- Date Released
- 1944
input | Date Released output |
---|---|
ca. 1940s | ~1940 |
ca. 1945 | ~1945 |
58 | 1958 |
1958 | 1958 |
1980s | ~1980 |
See Also
- Template:Filmjr
- Template:Date
- Template:DateUnpackA
- Template:DateUnpackB < - you are here
Template Data
This outputs the definition "infobox" version of release date. Add a link to year cat and shows a label, routed from DateUnpack with opt=b
Parameter | Description | Type | Status | |
---|---|---|---|---|
Year | yr 1 | 4 digit year
| Date | required |