From: Keith G. <kwg...@gm...> - 2005-06-10 00:58:19
|
On 6/9/05, Paul Kienzle <pki...@us...> wrote: > Applied. Thanks, >=20 > - Paul >=20 > On Jun 9, 2005, at 7:14 PM, Keith Goodman wrote: >=20 > > Is this how I submit a patch to octave-forge? > > > > main/time/datestr.m: Format 'dd' now pads with leading zero if day is > > less than 10. > > > > Current behaviour > > > > datestr(now,"dd") > > ans =3D 9 > > > > Patched behaviour (compatible and more consistent with dd in other > > contexts such as mm/dd/yyyy) > > > > datestr(now,"dd") > > ans =3D 09 > > > > --- datestr.m 2005-06-09 09:00:56.455208088 -0700 > > +++ datestr2.m 2005-06-09 09:01:58.381793816 -0700 > > @@ -27,7 +27,7 @@ > > ## @item 4 @tab m @tab S > > ## @item 5 @tab mm @tab 9 > > ## @item 6 @tab mm/dd @tab 09/07 > > -## @item 7 @tab dd @tab 7 > > +## @item 7 @tab dd @tab 07 > > ## @item 8 @tab ddd @tab Thu > > ## @item 9 @tab d @tab T > > ## @item 10 @tab yyyy @tab 2000 > > @@ -128,7 +128,7 @@ > > case { 6, 'mm/dd' } > > str =3D sprintf("%02d/%02d",M,D); > > case { 7, 'dd' } > > - str =3D sprintf("%d",D); > > + str =3D sprintf("%02d",D); > > case { 8, 'ddd' } > > [d,str] =3D weekday(datenum(Y,M,D)); > > case { 9, 'd' } Crap. Now I crashed on the format of 'mm'. I would have submitted it all at once had I known. $ diff -u datestr.m datestr2.m --- datestr.m 2005-06-09 17:49:14.677736696 -0700 +++ datestr2.m 2005-06-09 17:49:31.562169872 -0700 @@ -25,7 +25,7 @@ ## @item 2 @tab mm/dd/yy @tab 09/07/00 ## @item 3 @tab mmm @tab Sep ## @item 4 @tab m @tab S -## @item 5 @tab mm @tab 9 +## @item 5 @tab mm @tab 09 ## @item 6 @tab mm/dd @tab 09/07 ## @item 7 @tab dd @tab 07 ## @item 8 @tab ddd @tab Thu @@ -124,7 +124,7 @@ case { 4, 'm' } str =3D sprintf("%s",__month_names(M,1)); case { 5, 'mm' } - str =3D sprintf("%d",M); + str =3D sprintf("%02d",M); case { 6, 'mm/dd' } str =3D sprintf("%02d/%02d",M,D); case { 7, 'dd' } |