Template:Date/testcases

From MattWiki
Jump to: navigation, search

Sandbox vs live

With acceptable input

Input Output Sandbox
No format specified
{{date|2006-05-04}} 4 May 2006 Template:Date/sandbox
{{date|May 4, 2006}} 4 May 2006 Template:Date/sandbox
{{date|4 May 2006}} 4 May 2006 Template:Date/sandbox
{{date|4 May}} 4 May Template:Date/sandbox
{{date|May 4}} 4 May Template:Date/sandbox
dmy format
{{date|2006-05-04|dmy}} 4 May 2006 Template:Date/sandbox
{{date|May 4, 2006|dmy}} 4 May 2006 Template:Date/sandbox
{{date|4 May 2006|dmy}} 4 May 2006 Template:Date/sandbox
{{date|4 May|dmy}} 4 May Template:Date/sandbox
{{date|May 4|dmy}} 4 May Template:Date/sandbox
mdy format
{{date|2006-05-04|mdy}} May 4, 2006 Template:Date/sandbox
{{date|May 4, 2006|mdy}} May 4, 2006 Template:Date/sandbox
{{date|4 May 2006|mdy}} May 4, 2006 Template:Date/sandbox
{{date|4 May|mdy}} May 4 Template:Date/sandbox
{{date|May 4|mdy}} May 4 Template:Date/sandbox
ymd format
{{date|2006-05-04|ymd}} 2006 May 4 Template:Date/sandbox
{{date|May 4, 2006|ymd}} 2006 May 4 Template:Date/sandbox
{{date|4 May 2006|ymd}} 2006 May 4 Template:Date/sandbox
{{date|4 May|ymd}} May 4 Template:Date/sandbox
{{date|May 4|ymd}} May 4 Template:Date/sandbox
iso format
{{date|2006-05-04|iso}} 2006-05-04 Template:Date/sandbox
{{date|May 4, 2006|iso}} 2006-05-04 Template:Date/sandbox
{{date|4 May 2006|iso}} 2006-05-04 Template:Date/sandbox
{{date|4 May|iso}} May 4 Template:Date/sandbox
{{date|May 4|iso}} May 4 Template:Date/sandbox
none format
{{date|2006-05-04|none}} 2006-05-04 Template:Date/sandbox
{{date|May 4, 2006|none}} May 4, 2006 Template:Date/sandbox
{{date|4 May 2006|none}} 4 May 2006 Template:Date/sandbox
{{date|4 May|none}} 4 May Template:Date/sandbox
{{date|May 4|none}} May 4 Template:Date/sandbox

Other valid input

A wide variety of other input formats are handled correctly by the template:

Input Output Sandbox
{{date|1st December 2008}} (ordinal 'st') 1 December 2008 Template:Date/sandbox
{{date|June 24 2006}} (missing comma) 24 June 2006 Template:Date/sandbox
{{date|24 june 2006}} (lowercase month name) 24 June 2006 Template:Date/sandbox
{{date|24 jun}} (abbreviated month name) 24 June Template:Date/sandbox
{{date|June 2006}} June 2006 Template:Date/sandbox

Invalid input

Input strings that the template cannot format are returned unaltered. This includes strings containing characters such as square brackets, so any links will result in unformatted output.

Input Output Sandbox
{{date|23007-031-24}} 23007-031-24 Template:Date/sandbox
{{date|[[1 December]] [[2008]]|ymd}} 1 December 2008 Template:Date/sandbox
{{date|1 December [[2008 in film|2008]]|mdy}} 1 December 2008 Template:Date/sandbox

Subst sandbox vs live

With acceptable input

Input Output Sandbox
No format specified
{{date|2006-05-04}} 4 May 2006 4 May 2006
{{date|May 4, 2006}} 4 May 2006 4 May 2006
{{date|4 May 2006}} 4 May 2006 4 May 2006
{{date|4 May}} 4 May 4 May
{{date|May 4}} 4 May 4 May
dmy format
{{date|2006-05-04|dmy}} 4 May 2006 4 May 2006
{{date|May 4, 2006|dmy}} 4 May 2006 4 May 2006
{{date|4 May 2006|dmy}} 4 May 2006 4 May 2006
{{date|4 May|dmy}} 4 May 4 May
{{date|May 4|dmy}} 4 May 4 May
mdy format
{{date|2006-05-04|mdy}} 4 May 2006 May 4, 2006
{{date|May 4, 2006|mdy}} 4 May 2006 May 4, 2006
{{date|4 May 2006|mdy}} 4 May 2006 May 4, 2006
{{date|4 May|mdy}} 4 May May 4
{{date|May 4|mdy}} 4 May May 4
ymd format
{{date|2006-05-04|ymd}} 4 May 2006 2006 May 4
{{date|May 4, 2006|ymd}} 4 May 2006 2006 May 4
{{date|4 May 2006|ymd}} 4 May 2006 2006 May 4
{{date|4 May|ymd}} 4 May May 4
{{date|May 4|ymd}} 4 May May 4
iso format
{{date|2006-05-04|iso}} 4 May 2006 2006-05-04
{{date|May 4, 2006|iso}} 4 May 2006 2006-05-04
{{date|4 May 2006|iso}} 4 May 2006 2006-05-04
{{date|4 May|iso}} 4 May May 4
{{date|May 4|iso}} 4 May May 4
none format
{{date|2006-05-04|none}} 4 May 2006 2006-05-04
{{date|May 4, 2006|none}} 4 May 2006 May 4, 2006
{{date|4 May 2006|none}} 4 May 2006 4 May 2006
{{date|4 May|none}} 4 May 4 May
{{date|May 4|none}} 4 May May 4

Other valid input

A wide variety of other input formats are handled correctly by the template:

Input Output Sandbox
{{date|1st December 2008}} (ordinal 'st') 1 December 2008 1 December 2008
{{date|June 24 2006}} (missing comma) 24 June 2006 24 June 2006
{{date|24 june 2006}} (lowercase month name) 24 June 2006 24 June 2006
{{date|24 jun}} (abbreviated month name) 24 June 24 June
{{date|June 2006}} June 2006 June 2006

Invalid input

Input strings that the template cannot format are returned unaltered. This includes strings containing characters such as square brackets, so any links will result in unformatted output.

Input Output Sandbox
{{date|23007-031-24}} 23007-031-24 23007-031-24
{{date|[[1 December]] [[2008]]|ymd}} 1 December 2008 1 December 2008
{{date|1 December [[2008 in film|2008]]|mdy}} 1 December 2008 1 December 2008