Skip to content

Commit 62f193c

Browse files
committed
(fix) Datepicker: Use Globalize 1.0.0
- parseYMD
1 parent ae6b430 commit 62f193c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ui/datepicker.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,15 @@ widget = $.widget( "ui.datepicker", {
5353
},
5454

5555
_create: function() {
56-
var globalize;
5756
this.suppressExpandOnFocus = false;
5857

5958
this._setLocale( this.options.locale );
6059

61-
// FIXME: can we use Date instead?
6260
if ( $.type( this.options.max ) === "string" ) {
63-
this.options.max = globalize.parseDate( this.options.max , { pattern: "yyyy-MM-dd" } );
61+
this.options.max = this.options.locale.parseYMD( this.options.max );
6462
}
6563
if ( $.type( this.options.min ) === "string" ) {
66-
this.options.min = globalize.parseDate( this.options.min , { pattern: "yyyy-MM-dd" } );
64+
this.options.min = this.options.locale.parseYMD( this.options.min );
6765
}
6866

6967
this._createCalendar();
@@ -290,6 +288,9 @@ widget = $.widget( "ui.datepicker", {
290288
},
291289
parse: function( stringDate ) {
292290
return globalize.parseDate( stringDate, { date: "short" } );
291+
},
292+
parseYMD: function( stringDate ) {
293+
return globalize.parseDate( stringDate, { pattern: "yyyy-MM-dd" } );
293294
}
294295
};
295296
}

0 commit comments

Comments
 (0)