Skip to content

timeMinute, timeHour are sometimes wrong (Chrome 67). #29

@mbostock

Description

@mbostock

For example, given the date 1732-02-22T00:07:00.766:

date = new Date(-7506057601234)

d3.timeSecond works as expected:

d3.timeSecond(date) // 1732-02-22T00:07

d3.timeMinute should return 1732-02-22T00:07, but doesn’t:

d3.timeMinute(date) // 1732-02-22T00:06:02

d3.timeHour should return 1732-02-22T00:00, but doesn’t:

d3.timeHour(date) // 1732-02-21T23:59:02

https://beta.observablehq.com/d/3a8558e7a5a27d6e

The implementation of timeHour and timeMinute assume that minutes are 60-second and 3,600-second multiples from UNIX epoch, but apparently that’s no longer the case in the latest version of Chrome (leap seconds maybe?), so we may require a slower strategy.

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