mirror of
https://github.com/storytold/gridcraft.git
synced 2026-11-10 12:29:58 -06:00
Excel's EDATE and EOMONTH read serial 0 as 0 January 1900 and end February 1900 on the 28th (serial 59), although the sheet itself keeps the Lotus 29 February 1900 (serial 60). GridCraft clamped day 0 up to day 1 and used the sheet's 29-day February, so EDATE(0,0) was 1, EDATE(0,1) 32, EDATE(31,1) and EOMONTH(59,0) 60. EDATE now keeps day 0 and both functions take the real calendar's month lengths. Serial 60 still reads as 29 February, so EDATE(60,1) stays 29 March. DATE, DAY and the parser keep the leap day. Tests: the Excel 365 table from the issue; the #124 cases that expected 60 at the end of February 1900 now expect 59.