From: Keith G. <kwg...@gm...> - 2005-06-09 23:14:53
|
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' } |
From: Paul K. <pki...@us...> - 2005-06-10 00:10:20
|
Applied. Thanks, - Paul On Jun 9, 2005, at 7:14 PM, Keith Goodman wrote: > 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 = 9 > > Patched behaviour (compatible and more consistent with dd in other > contexts such as mm/dd/yyyy) > > datestr(now,"dd") > ans = 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 = sprintf("%02d/%02d",M,D); > case { 7, 'dd' } > - str = sprintf("%d",D); > + str = sprintf("%02d",D); > case { 8, 'ddd' } > [d,str] = weekday(datenum(Y,M,D)); > case { 9, 'd' } > > > ------------------------------------------------------- > This SF.Net email is sponsored by: NEC IT Guy Games. How far can you > shotput > a projector? How fast can you ride your desk chair down the office > luge track? > If you want to score the big prize, get to know the little guy. > Play to win an NEC 61" plasma display: http://www.necitguy.com/?r > _______________________________________________ > Octave-dev mailing list > Oct...@li... > https://lists.sourceforge.net/lists/listinfo/octave-dev > |
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' } |
From: Paul K. <pki...@us...> - 2005-06-12 14:42:56
|
On Jun 9, 2005, at 8:58 PM, Keith Goodman wrote: > 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 = sprintf("%s",__month_names(M,1)); > case { 5, 'mm' } > - str = sprintf("%d",M); > + str = sprintf("%02d",M); > case { 6, 'mm/dd' } > str = sprintf("%02d/%02d",M,D); > case { 7, 'dd' } Applied. Note that the 5.2 documentation on the web gives the example of '3' for format 'mm'. Was the documentation wrong or has the definition changed? Is there any way we can support scripts written for older versions? Even if there were, should we bother? Maintaining compatibility with a language which doesn't even stay compatible with itself is frustrating. - Paul |