Skip to content

Commit a9ba165

Browse files
lboullo0jzaefferer
authored andcommitted
Additionals: Fix dateITA method to deal with DST bug
Fixes jquery-validation#264 Closes jquery-validation#1144 Fix to Bug with dateITA and daylight saving time jquery-validation#264
1 parent f85d4b7 commit a9ba165

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/additional/dateITA.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ $.validator.addMethod("dateITA", function(value, element) {
2727
mm = parseInt(adata[1],10);
2828
aaaa = parseInt(adata[2],10);
2929
xdata = new Date(aaaa, mm - 1, gg, 12, 0, 0, 0);
30-
if ( ( xdata.getFullYear() === aaaa ) && ( xdata.getMonth() === mm - 1 ) && ( xdata.getDate() === gg ) ) {
30+
if ( ( xdata.getUTCFullYear() === aaaa ) && ( xdata.getUTCMonth () === mm - 1 ) && ( xdata.getUTCDate() === gg ) ) {
3131
check = true;
3232
} else {
3333
check = false;

0 commit comments

Comments
 (0)