Skip to content

numberToSimpleDate returns day 0 for 31 December of some years when leapYear1900 is true #1793

Open

Description

@marcin-kordas-hoc

With leapYear1900: true, numberToSimpleDate decomposes 31 December of 32 years between 1900 and 2200 (for example 2036 and 2040) as day 0 of January of the next year. =EOMONTH(DATE(2036,12,31),0) returns 31 January 2037, and TEXT of that serial shows 2037-01-00. It happens with and without nullDate 1899-12-31.

The year check in that function compares against {year: year - 1, …} where {year, …} looks intended. Changing it brings the 32 affected years to 0 in both leap configurations, leaves the default configuration unchanged, and the 80 date, EDATE, EOMONTH and DAY specs I ran still pass.

Found while reviewing #1781. That PR doesn't cause it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions