Difference between revisions of "Template:DateUnpackB/doc"

From Ephemeral Film Wiki
Jump to navigation Jump to search
 
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Documentation subpage}}
{{Documentation subpage}}
== 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.
{|
|+ DateUnpackB Assumptions
|-
! 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
{| class="wikitable"
|+ how it prints
|-
! input !! Date Released output
|-
| ca. 1940s || ~1940
|-
| ca. 1945 || ~1945
|-
| 58 || 1958
|-
| 1958 || 1958
|-
| 1980s || ~1980
|}
== See Also ==
* [[Template:Filmjr]]
* [[Template:Filmjr]]
* [[Template:Date]]
**[[Template:DateUnpackA]]
**[[Template:DateUnpackB]] < - you are here
*** [[Template:DateB Year Released]]
* {{Purge}}
[[Category:JR templates]]
[[Category:JR templates]]
== Template Data ==
<templatedata>
<templatedata>
{
{
Line 16: Line 75:
}
}
},
},
"description": "add a link to year cat and shows a label, routed from DateUnpack with opt=b"
"description": "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"
}
}
</templatedata>
</templatedata>

Latest revision as of 20:31, 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.

DateUnpackB Assumptions
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
how it prints
input Date Released output
ca. 1940s ~1940
ca. 1945 ~1945
58 1958
1958 1958
1980s ~1980

See Also

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

Template parameters

ParameterDescriptionTypeStatus
Yearyr 1

4 digit year

Example
1955
Daterequired