I get that .later( :1month) is problematic for the last day(s),
particularly someone stepping month by month from 2021-12-31
may not expect to get 2022-03-28.  But that can be considered
naive.

But for .later( :1year ) from a leap day, I am finding reports
that YYYY-03-1 is legalistically correct in the USA.  This is
generally applied to establish age, old enough to:  learn to
drive, vote, be sentenced as an adult.  And the 'logic' is each
s the 60th day of the year.




For .later( :1year) 
On Mon, Dec 13, 2021 at 09:27:58PM +0100, Elizabeth Mattijsen wrote:
> > On 13 Dec 2021, at 05:23, rir <rir...@comcast.net> wrote:
> > 
> > 
> > REPL says:
> >> Date.new("2024-02-29").later( :1year);
> >    2025-02-28
> > 
> > Is the following some standard?
> 
> I'm not sure...
> 
> Basically when moving by month / year, it just basically moves that field in 
> the date, and then checks for validity of the resulting date, and then adapts 
> (within the given month) to the first legal date.
> 
> Since you're moving by month / year, it felt as the way for the least 
> surprise.
> 
> 
> 
> Liz

Reply via email to