Difference between revisions of "OmniPrereleases/FormatName"
From Sega Retro
Line 1: | Line 1: | ||
<includeonly>{{#vardefine:currentprotoname|{{#sub:{{{1}}}|{{#expr:{{#pos:{{{1}}}|;}}+1}}}}}}{{ | <includeonly>{{#vardefine:currentprotoname|{{#sub:{{{1}}}|{{#expr:{{#pos:{{{1}}}|;}}+1}}}}}}{{ | ||
− | # | + | |
− | + | #ifexpr:{{#len:{{#var:currentprotoname}}}}>=10|{{ | |
+ | #switch:{{#sub:{{#var:currentprotoname}}|0|4}} | ||
+ | <!--check the first four characters are a valid year. ifexpr fails if it's not an integer --> | ||
+ | |1970|1971|1972|1973|1974|1975|1976|1977|1978|1979 | ||
+ | |1980|1981|1982|1983|1984|1985|1986|1987|1988|1989 | ||
+ | |1990|1991|1992|1993|1994|1995|1996|1997|1998|1999 | ||
+ | |2000|2001|2002|2003|2004|2005|2006|2007|2008|2009 | ||
+ | |2010|2011|2012|2013|2014|2015|2016|2017|2018|2019 | ||
+ | |2020|2021|2022|2023|2024|2025|2026|2027|2028|2029={{#vardefine:lastyear|{{#var:currentyear}}}}{{#vardefine:currentyear|{{#sub:{{#var:currentprotoname}}|0|4}}}}{{ | ||
+ | #ifeq:{{#var:lastyear}} | ||
|{{#var:currentyear}} | |{{#var:currentyear}} | ||
|{{#vardefine:currentprotoname|{{#sub:{{#var:currentprotoname}}|5}}}} | |{{#vardefine:currentprotoname|{{#sub:{{#var:currentprotoname}}|5}}}} | ||
}} | }} | ||
+ | }} | ||
|}}{{#var:currentprotoname}}</includeonly><noinclude>Split off because it was starting to get complicated. | |}}{{#var:currentprotoname}}</includeonly><noinclude>Split off because it was starting to get complicated. | ||
Revision as of 12:32, 4 March 2022
Split off because it was starting to get complicated.
This template formats the names of prototypes so they're not excessively wordy in Omni templates.
Examples
{{OmniPrereleases/FormatName|Mega Drive prototype; 1994-04-18}}
1994-04-18
- 12-08
- 12-14
- 12-28 SB
- 1995-01-01 TST
- 01-03 TST
- 01-05
- 01-09 TST
- 01-10
- 01-14 RM
- 01-16
- 01-18 RM
- 01-20
- 01-25
- 01-30
- 02-02
- 02-03
- 02-07
- 02-09 B
- 02-09
- 02-11
- 02-12
- 02-13
- 02-14
- 02-15