%!demo
%! ## `calendarDuration` represents a span in *calendar* units — years, months,
%! ## days, and a time-of-day.  A calendar month or year is a real calendar step,
%! ## not a fixed number of days, which is what sets it apart from `duration`.
%! ## Give years, months and days:
%!
%! calendarDuration (1, 3, 10)

%!demo
%! ## Overflowing whole units normalise: 14 months rolls up into 1 year 2 months.
%! ## Days are kept separate (a month has no fixed number of days), so 40 stays 40.
%!
%! calendarDuration (1, 14, 40)

%!demo
%! ## The six-argument form adds a time-of-day: years, months, days, hours,
%! ## minutes, seconds.
%!
%! calendarDuration (0, 2, 5, 6, 30, 0)

%!demo
%! ## The `'Format'` option controls how the SAME span is broken down for display.
%! ## A format must contain `m`, `d` and `t`; it may also use `y` (years),
%! ## `q` (quarters) and `w` (weeks), listed in the order y q m w d t.  Here one
%! ## span shown four ways:
%!
%! calendarDuration (1, 14, 40, 'Format', 'ymdt')
%! calendarDuration (1, 14, 40, 'Format', 'mdt')
%! calendarDuration (1, 14, 40, 'Format', 'qmwdt')
%! calendarDuration (1, 14, 40, 'Format', 'ymwdt')

%!demo
%! ## A numeric matrix with three (or six) columns builds a whole array at once —
%! ## one calendar duration per row.
%!
%! calendarDuration ([1, 2, 15; 0, 6, 3])

%!demo
%! ## Passing an existing array back through the constructor copies it, size and
%! ## display format included.  Adding `'Format'` re-formats the copy and leaves
%! ## the original alone, which is the tidy way to show one span two ways.
%!
%! calD = calendarDuration (1, 14, 40, 'Format', 'qmwdt')
%! calendarDuration (calD, 'Format', 'ymdt')
%! calD
