跳转到内容

Template:Age/testcases

维基百科,自由的百科全书

测试

[编辑]
{{Age|1989|7|23|2003|7|14}}
{{Age|1989|7|23|2003|7|14}}
左右对比
{{Age}}{{Age/sandbox}}
13 13
{{Age|1989|7|0|2003|7|14}}
{{Age|1989|7|0|2003|7|14}}
左右对比
{{Age}}{{Age/sandbox}}
14 14
{{Age|1989|0|0|2003|7|14}}
{{Age|1989|0|0|2003|7|14}}
左右对比
{{Age}}{{Age/sandbox}}
14 14
{{Age|1989|7|23}}
  • {{Age|1989|7|23}} → <span class="currentage"></span>35
  • {{Age/sandbox|1989|7|23}} → <span class="currentage"></span>35
  • Expected: 32 (as of 2021)
{{Age|23 July 1989|14 July 2003}}
{{Age|23 July 1989|14 July 2003}}
左右对比
{{Age}}{{Age/sandbox}}
13 13
{{Age|July 1989|2003}}
{{Age|July 1989|2003}}
左右对比
{{Age}}{{Age/sandbox}}
14 14
{{Age||-215|8|2}}
  • {{Age||-215|8|2}} → <strong class="error">错误:需要有效的年月日</strong>
  • {{Age/sandbox||-215|8|2}} → <strong class="error">错误:需要有效的年月日</strong>
  • Expected: 2236 (as of 2021)
{{Age|August 2, 216 BCE}}
  • {{Age|August 2, 216 BCE}} → <span class="currentage"></span>2239
  • {{Age/sandbox|August 2, 216 BCE}} → <span class="currentage"></span>2239
  • Expected: 2236 (as of 2021)
{{Age|format=commas|-215|8|2}}
  • {{Age|format=commas|-215|8|2}} → <span class="currentage"></span>2,239
  • {{Age/sandbox|format=commas|-215|8|2}} → <span class="currentage"></span>2,239
  • Expected: 2,236 (as of 2021)
{{Age|format=cardinal|1970|1|1|1998|2|1}}
{{Age|format=cardinal|1970|1|1|1998|2|1}}
左右对比
{{Age}}{{Age/sandbox}}
twenty-eight twenty-eight
{{Age|1970|1|1|1998|2|1}}
{{Age|1970|1|1|1998|2|1}}
左右对比
{{Age}}{{Age/sandbox}}
28 28
{{Age|2010}}
  • {{Age|2010}} → <span class="currentage"></span>14
  • {{Age/sandbox|2010}} → <span class="currentage"></span>14
  • Expected: 11 (as of 2021)
{{Age|format=raw|2010}}
  • {{Age|format=raw|2010}} → 14
  • {{Age/sandbox|format=raw|2010}} → 14
  • Expected: 11 (as of 2021)