Skip to content

Bug with dateITA and daylight saving time #264

@rcapile

Description

@rcapile

The dateITA does not validade dates when the date it´s the begging of DST.

For example (in Brazil) the Date 16/10/1966 fails.

When you analyze the date, the var gg is set to 16 but new Date(1966,9,16) returns Date {Sat Oct 15 1966 23:00:00 GMT-0300}.

So when you compare xdata.getDate() == gg (at line 143) it fails because gg is 16.

A workaround I'm using is to change the line 143

if ( ( xdata.getFullYear() == aaaa ) && ( xdata.getMonth () == mm - 1 ) && ( xdata.getDate() == gg ) )

to

if ( ( xdata.getUTCFullYear() == aaaa ) && ( xdata.getUTCMonth () == mm - 1 ) && ( xdata.getUTCDate() == gg ) )

so the DST is ignored. I admit : I didn´t do a good test with older browsers.

Does it makes sense?

BTW, great plugin!

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