I couldn't find any info about this operator >> with dates.
So, for example, if I have 2007-01-01 and I want to know the last day of
adding three months (2007-03-31) I would do:
d = Date.new(2007,1,1)
((d >> 3)-1).to_s
it works, but we can relay on this operations ?
It's standard Ruby
shadowfax:~/ssanta rick$ qri "Date#<<"
---------------------------------------------------------------- Date#<<
<<(n)
------------------------------------------------------------------------
Return a new Date object that is n months earlier than the current
one.
If the day-of-the-month of the current Date is greater than the
last day of the target month, the day-of-the-month of the returned
Date will be the last day of the target month.
shadowfax:~/ssanta rick$ qri "Date#>>"
---------------------------------------------------------------- Date#>>------------------------------------------------------------------------
Return a new Date object that is n months later than the current
one.
If the day-of-the-month of the current Date is greater than the
last day of the target month, the day-of-the-month of the returned
Date will be the last day of the target month.