GenericYear does this.  The generic Year will take
   '2/29/2000' asDate + 1 year "=> 28 February 2001"
In other words, we want it at the same time next year; more importantly the
same month and close to what we have now.
Also:
   '3/1/2001' asDate - 1 year "=> 1 March 2000"
Still, same month - we want to be at the beginning of the month the
previous year.

Basically, my idea (and, more importantly, what I expect - hence my code)
is that I want to pretend that we do have a field-based representation and
make it work that way.  except better (since there is no 2/29/2001).

> Ej, which one of the followings is OK?
> '2011-03-01' asDate + 1 year "=> 2012-02-29"

Well, I have a bug here.  That needs to be fixed.

-cbc


On Tue, Dec 2, 2014 at 8:34 AM, Sean P. DeNigris <[email protected]>
wrote:

> Esteban A. Maringolo wrote
> > Ej, which one of the followings is OK?
> > '2012-02-29' asDate + 1 year  "=> 2013-02-28"
> > '2011-03-01' asDate + 1 year "=> 2012-02-29"
>
> One solution (just ignore the source ha ha) -
>
> http://msdn.microsoft.com/en-us/library/system.datetime.addyears%28v=vs.110%29.aspx
>
>
>
> -----
> Cheers,
> Sean
> --
> View this message in context:
> http://forum.world.st/Duration-year-tp4791727p4793656.html
> Sent from the Pharo Smalltalk Developers mailing list archive at
> Nabble.com.
>
>

Reply via email to