It makes sense to add a Duration to a DateAndTime. It does not make sense to add a Duration to a Date. I can't check Pharo because I haven't managed to get it working on this laptop (x86-64 + ubuntu 17), but Squeak has Date>>addMonths: (edited for clarity): addMonths: monthCount |m year month maxDaysInMonth day| m := monthCount + self monthIndex - 1. year := m // 12 + self year. month := m \\ 12 + 1. maxDaysInMonth := Month daysInMonth: month forYear: year. day := self dayOfMonth min: maxDaysInMonth. ^ Date newDay: day month: month year: year This may or may not do what your customer wants. On 26 February 2018 at 22:43, Petr Fischer <petr.fischer@me.com> wrote:
Hello, just simple test:
(Date year: 2019 month: 2 day: 26) + 1 year. returns: 26 February 2020 OK
(Date year: 2020 month: 2 day: 26) + 1 year. returns: 25 February 2021 What?
(maybe I do not understand something about dates again)
Thanks! pf