Forgot to say that this is something you can experience quite often. To me the problem is that 1 year gives a duration immediately. It should work as all units that 1 year is a unit of magnitude 1 and unit year. If you apply this to a date you could make it properly to give the date one year later. I noticed that problem when I started to use the Units package of Marcus. It works for all units except durations because these are already taken. So for me there would be two benefits changing that. Norbert
Am 26.02.2018 um 10:48 schrieb Norbert Hartl <norbert@hartl.name>:
Am 26.02.2018 um 10:43 schrieb Petr Fischer <petr.fischer@me.com>:
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)
That is a conceptual problem. 1 year is a duration. As it does not know which year it is the normal 365 days. And 2020 is a leap year so has 366 days. Thatâs why the date is shifted.
Norbert