Template:Version to date

From RimWorld Wiki
Revision as of 16:49, 1 November 2022 by Ickputzdirwech (talk | contribs) (should work from 27 Feb 2013 (0.0.0) until 29 Feb 2400)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Documentation icon Template documentation[view] [edit] [history] [purge]

Summary

This template converts the last part of the version number, which represents the number of days since one of the first builds of RimWorld, into the date of the release of that particular version.

This templates takes leap years until Feb 28, 2400 into account.

Usage

Simply add {{Version to date}} to any subpage with a name like "Version/<version number>" (e.g. Version/1.3.3069).

Alternatively you can simply add the the version number as the first parameter like {{Version to date|Version/1.3.3069}}, {{Version to date|1.3.3069}} or even {{Version to date|3069}}.

Examples

The (fictional) '''version 0.0.0''' would have been released on {{#time: F j, Y | {{Version to date|0.0.0}} }}.

The (fictional) version 0.0.0 would have been released on Error: Invalid time..

The current '''version {{Current Version}}''' has been released on {{#time: F j, Y | {{Version to date|{{Current Version}} }} }}.

The current version 1.5.4241 has been released on Error: Invalid time..

Test cases

Specific versions

{{Version to date|1.3.3069}} was released on 2021-07-24 and returns Version: 1.3.3069; Date: 2021-07-24
Ex.png

{{Version to date|1.4.3530}} was released on 2022-10-28 and returns Version: 1.4.3530; Date: 2022-10-28
Ex.png

Special dates

Common year to leap year

{{Version to date|2498}} should result in 2019-12-31 and returns: Version: 2498; Date: 2019-12-31
Ex.png

{{Version to date|2499}} should result in 2020-01-01 and returns: Version: 2499; Date: 2020-01-01
Ex.png

February to March in leap year

{{Version to date|2557}} should result in 2020-02-28 and returns: Version: 2557; Date: 2020-02-28
Ex.png

{{Version to date|2558}} should result in 2020-02-29 and returns: Version: 2558; Date: 2020-02-29
Ex.png

{{Version to date|2559}} should result in 2020-03-01 and returns: Version: 2559; Date: 2020-03-01
Ex.png

March to April in leap year

{{Version to date|2589}} should result in 2020-03-31 and returns: Version: 2589; Date: 2020-03-31
Ex.png

{{Version to date|2590}} should result in 2020-04-01 and returns: Version: 2590; Date: 2020-04-01
Ex.png

Leap year to common year

{{Version to date|2864}} should result in 2020-12-31 and returns: Version: 2864; Date: 2020-12-31
Ex.png

{{Version to date|2865}} should result in 2021-01-01 and returns: Version: 2865; Date: 2021-01-01
Ex.png

February to March in common year

{{Version to date|2923}} should result in 2021-02-28 and returns: Version: 2923; Date: 2021-02-28
Ex.png

{{Version to date|2924}} should result in 2021-03-01 and returns: Version: 2924; Date: 2021-03-01
Ex.png

March to April in common year

{{Version to date|2954}} should result in 2021-03-31 and returns: Version: 2954; Date: 2021-03-31
Ex.png

{{Version to date|2955}} should result in 2021-04-01 and returns: Version: 2955; Date: 2021-04-01
Ex.png


0.0.232 was released on October 16, 2013

Version: 0.0.232; Date: 2013-10-17


0.0.245 was released on October 29, 2013

Version: 0.0.245; Date: 2013-10-30


1.3.3069 was released on July 24, 2021

Version: 1.3.3069; Date: 2021-07-24



STANDARTD YEAR to LEAP YEAR

Version: test.0-57+365*7-1; Date: 2019-12-30


Version: test.0-57+365*7; Date: 2019-12-31


Version: test.0-57+365*7+1; Date: 2020-01-01



FEB to MAR in LEAP YEAR

Version: test.0-57+365*7+58; Date: 2020-02-27


Version: test.0-57+365*7+59; Date: 2020-02-28


Version: test.0-57+365*7+60; Date: 2020-02-29


Version: test.0-57+365*7+61; Date: 2020-03-01



MAR to MAY in LEAP YEAR

Version: test.0-57+365*7+62+29; Date: 2020-03-31


Version: test.0-57+365*7+62+30; Date: 2020-04-01



LEAP YEAR to STANDARD YEAR

Version: test.0-57+365*8+0; Date: Error: Invalid time.


Version: test.0-57+365*8+1; Date: 2020-12-31


Version: test.0-57+365*8+2; Date: 2021-01-01



FEB to MAR in STANDARD YEAR

Version: test.0-57+365*8+60; Date: 2021-02-28


Version: test.0-57+365*8+61; Date: 2021-03-01



MAR to MAY in STANDARD YEAR

Version: test.0-57+365*8+62+29; Date: 2021-03-31


Version: test.0-57+365*8+62+30; Date: 2021-04-01



Version: 0; Date: 2013-02-27
Version: 1; Date: 2013-02-28
Version: 2; Date: 2013-03-01
Version: 3; Date: 2013-03-02
Version: 4; Date: 2013-03-03
Version: 5; Date: 2013-03-04
Version: 6; Date: 2013-03-05
Version: 7; Date: 2013-03-06
Version: 8; Date: 2013-03-07
Version: 9; Date: 2013-03-08
Version: 10; Date: 2013-03-09
Version: 11; Date: 2013-03-10
Version: 12; Date: 2013-03-11
Version: 13; Date: 2013-03-12