dateAdd "years" with Feb. 29 in leap year produces wrong date

Wappler Version : 2.1.5
Operating System : Mac / PHP

Expected behavior

What do you think should happen?

The following should produce: “2019-02-28T00:00:00”

{{'2020-02-29'.dateAdd("years", -1)}}

Similarly, when using +1, it should produce: “2021-02-28T00:00:00”

Actual behavior

What actually happens?

With -1 it produces: “2019-03-01T00:00:00”
With +1 it produces: “2021-03-01T00:00:00”

How to reproduce

On server connect, PHP it just breaks on leap year Feb. 29. :slight_smile:

Not sure if it impacts other areas.

Community Page
Last updated: