Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Account for leap year bug; fixes #264 #292
Excel reproduces a bug from Lotus 1-2-3: the non-existent leap day February 29, 1900 is included in the date system. This only affects sheets that use the 1900 date system and dates prior to March 1, 1900.
The proposed fix effectively removes that date. I adjust (increment) date-times on or before February 28, 1900. I convert date-times on February 29 1900 -- a day which does not actually exist -- to NA and throw a warning.
Since knowledge of the date system is now required for both the leap year adjustment and the offset, I store and pass the 1900 vs 1904 indicator around instead of the offset.