# HG changeset patch # User Markus Mützel # Date 1651776618 -7200 # Node ID 95cb7ebba1a97438403daee7878739d56ed3eb2f # Parent e33444cd822f1de261b129b9c58795ae715e947c# Parent 1ce1c4552d5b04faf0cb653cbfe744725a3702bf maint: Merge stable to default. diff -r e33444cd822f -r 95cb7ebba1a9 scripts/time/datenum.m --- a/scripts/time/datenum.m Thu May 05 19:26:09 2022 +0200 +++ b/scripts/time/datenum.m Thu May 05 20:50:18 2022 +0200 @@ -136,8 +136,7 @@ endif ## Preserve shape if necessary, and work with column vectors ## for the remainder of the function. - do_reshape = (columns (year) > 1 || columns (month) > 1 - || columns (day) > 1); + do_reshape = ! iscolumn (day); if (do_reshape) sz_reshape = size (day); year = year(:); @@ -217,6 +216,8 @@ %! n = n'; %! assert (datenum (t(1,:), t(2,:), t(3,:), t(4,:), t(5,:), t(6,:)), n, 2*eps); +%!assert (size (datenum (2000, 1, ones(1, 1, 3))), [1 1 3]) + ## Test fractional years including leap years %!assert (fix (datenum ([2001.999 1 1; 2001.999 2 1])), [731216; 731247]) %!assert (fix (datenum ([2004.999 1 1; 2004.999 2 1])), [732312; 732343])