Taglib tests: DateRange tag

This page tests that the Rivendell DateRange tag behaves as expected.

Results - different year/month/day

Test Expected Actual Result
Default formatting with start/end date <r:DateRange start="2011-12-31" end="2012-01-01" /> Saturday 31st December 2011 to Sunday 1st January 2012 Saturday 31st December 2011 to Sunday 1st January 2012 PASS
Default formatting with duration <r:DateRange start="2011-12-31" duration="1" /> Saturday 31st December 2011 to Sunday 1st January 2012 Saturday 31st December 2011 to Sunday 1st January 2012 PASS
No ordinals <r:DateRange start="2011-12-31" end="2012-01-01" ordinal="false" /> Saturday 31 December 2011 to Sunday 1 January 2012 Saturday 31 December 2011 to Sunday 1 January 2012 PASS
Custom formatting with start/end date <r:DateRange start="2011-12-31" end="2012-01-01" day="EE d" month="MMM" year="yy" /> Sat 31st Dec 11 to Sun 1st Jan 12 Sat 31st Dec 11 to Sun 1st Jan 12 PASS
Custom formatting stating no day number with start/end date <r:DateRange start="2011-12-31" end="2012-01-01" day="EE" month="MMM" year="yyyy" /> Sat Dec 2011 to Sun Jan 2012 Sat Dec 2011 to Sun Jan 2012 PASS
Custom separator formatting with start/end date <r:DateRange start="2011-12-31" end="2012-01-01" separator="until" /> Saturday 31st December 2011 until Sunday 1st January 2012 Saturday 31st December 2011 until Sunday 1st January 2012 PASS

Results - same year but different month/day

Test Expected Actual Result
Default formatting with start/end date <r:DateRange start="2012-01-30" end="2012-02-03" /> Monday 30th January to Friday 3rd February 2012 Monday 30th January to Friday 3rd February 2012 PASS
Default formatting with duration <r:DateRange start="2012-01-30" duration="4" /> Monday 30th January to Friday 3rd February 2012 Monday 30th January to Friday 3rd February 2012 PASS
No ordinals <r:DateRange start="2012-01-30" end="2012-02-03" ordinal="false" /> Monday 30 January to Friday 3 February 2012 Monday 30 January to Friday 3 February 2012 PASS
Custom formatting with start/end date <r:DateRange start="2012-01-30" end="2012-02-03" day="EE d" month="MMM" year="yy" /> Mon 30th Jan to Fri 3rd Feb 12 Mon 30th Jan to Fri 3rd Feb 12 PASS
Custom formatting stating no day number with start/end date <r:DateRange start="2012-01-30" end="2012-02-03" day="EE" month="MMM" year="yyyy" /> Mon Jan to Fri Feb 2012 Mon Jan to Fri Feb 2012 PASS
Custom separator formatting with start/end date <r:DateRange start="2012-01-30" end="2012-02-03" separator="until" /> Monday 30th January until Friday 3rd February 2012 Monday 30th January until Friday 3rd February 2012 PASS

Results - same year and month but different day

Test Expected Actual Result
Default formatting with start/end date <r:DateRange start="2012-01-30" end="2012-01-31" /> Monday 30th to Tuesday 31st January 2012 Monday 30th to Tuesday 31st January 2012 PASS
Default formatting with duration <r:DateRange start="2012-01-30" duration="1" /> Monday 30th to Tuesday 31st January 2012 Monday 30th to Tuesday 31st January 2012 PASS
No ordinals <r:DateRange start="2012-01-30" end="2012-01-31" ordinal="false" /> Monday 30 to Tuesday 31 January 2012 Monday 30 to Tuesday 31 January 2012 PASS
Custom formatting with start/end date <r:DateRange start="2012-01-30" end="2012-01-31" day="EE d" month="MMM" year="yy" /> Mon 30th to Tue 31st Jan 12 Mon 30th to Tue 31st Jan 12 PASS
Custom formatting stating no day number with start/end date <r:DateRange start="2012-01-30" end="2012-01-31" day="EE" month="MMM" year="yyyy" /> Mon to Tue Jan 2012 Mon to Tue Jan 2012 PASS
Custom separator formatting with start/end date <r:DateRange start="2012-01-30" end="2012-01-31" separator="until" /> Monday 30th until Tuesday 31st January 2012 Monday 30th until Tuesday 31st January 2012 PASS

Results - same year and month and day

Test Expected Actual Result
Default formatting with start/end date <r:DateRange start="2012-01-30" end="2012-01-30" /> Monday 30th January 2012 Monday 30th January 2012 PASS
Default formatting with duration <r:DateRange start="2012-01-30" duration="0" /> Monday 30th January 2012 Monday 30th January 2012 PASS
No ordinals <r:DateRange start="2012-01-30" end="2012-01-30" ordinal="false" /> Monday 30 January 2012 Monday 30 January 2012 PASS
Custom formatting with start/end date <r:DateRange start="2012-01-30" end="2012-01-30" day="EE d" month="MMM" year="yy" /> Mon 30th Jan 12 Mon 30th Jan 12 PASS
Custom formatting stating no day number with start/end date <r:DateRange start="2012-01-30" end="2012-01-30" day="EE" month="MMM" year="yyyy" /> Mon Jan 2012 Mon Jan 2012 PASS
Custom separator formatting with start/end date <r:DateRange start="2012-01-30" end="2012-01-30" separator="until" /> Monday 30th January 2012 Monday 30th January 2012 PASS

Results - using time

Test Expected Actual Result
Default formatting with start/end date and time enabled <r:DateRange start="2012-01-30 12:00:00 GMT" end="2012-02-03 13:00:00 GMT" showtime="true" /> 12:00PM Monday 30th January to 1:00PM Friday 3rd February 2012 12:00PM Monday 30th January to 1:00PM Friday 3rd February 2012 PASS
Default formatting with start/end date and time format specified <r:DateRange start="2012-01-30 12:00:00 GMT" end="2012-02-03 13:00:00 GMT" showtime="true" time="HH:mm" /> 12:00PM Monday 30th January to 1:00PM Friday 3rd February 2012 12:00 Monday 30th January to 13:00 Friday 3rd February 2012 PASS

Results - other tests

Test Expected Actual Result
Same year/month/day with numeric formatting and custom spacer <r:DateRange start="2012-03-01 00:00:00 GMT" ordinal="false" end="2012-03-01" spacer="/" day="dd" month="MM" year="yyyy" /> 01/03/2012 01/03/2012 PASS
Different day with numeric formatting and custom spacer/separator <r:DateRange start="2012-03-01 00:00:00 GMT" ordinal="false" separator="-" spacer="/" end="2012-03-02" day="dd" month="MM" year="yyyy" /> 01 - 02/03/2012 01 - 02/03/2012 PASS
Using duration with empty day/month/year/separator (falls back to defaults) Thursday 15th to Friday 16th November 2012 Thursday 15th to Friday 16th November 2012 PASS
Using duration with 'space' for day/month/year/separator   PASS