jzaefferer/jquery-validation — Issue #264: Bug with dateITA and daylight saving time
Author: rcapile
Created: 2011-11-28 14:34:15+00:00
State: open

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!