Skip to content

Daylight Saving Time Fix #14

@sllloyd

Description

@sllloyd

dtsel/dtsel.js

Line 391 in 502cae8

var start = new Date(this.year, this.month, 1);

The problems reported each October/November with duplicate days are due to a known feature wit Date() and Daylight Saving Time (see https://learn.microsoft.com/en-us/troubleshoot/developer/browsers/core-features/error-dst-time-zones). The fix is to replace:
var start = new Date(this.year, this.month, 1);
with
var start = new Date(this.year, this.month, 1, 12);
This sets the time to midday rather than midnight so the change by one hour doesn't change the day.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions