I love Chalten :)
But you know it :)

Stef
Le 2/12/14 11:53, Maximiliano Taborda a ��crit��:
Hi all.

The same examples using Chalt��n:
�� �� ��February twentyninth, 2012 next: 1 yearMeasure. �� "=> February 28th, 2013"��
�� �� ��March first, 2011 next: 1 yearMeasure. ��"=> March 1st, 2012"��
�� �� ��March first, 2011 next: 12 monthsMeasure. "=> March 1st, 2012"

Hilaire, In Chalt��n a year is a year so you don't need to care about of the number of days in it.

Regards.
Maxi


2014-12-02 16:37 GMT-03:00 Chris Cunningham <cunningham.cb@gmail.com>:
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 <sean@clipperadams.com> 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.