]> source.dussan.org Git - jquery-ui.git/commitdiff
(fix) Datepicker: Use Globalize 1.0.0
authorRafael Xavier de Souza <rxaviers@gmail.com>
Thu, 4 Sep 2014 18:47:48 +0000 (15:47 -0300)
committerFelix Nagel <info@felixnagel.com>
Tue, 28 Jul 2015 22:04:00 +0000 (00:04 +0200)
- parseYMD

ui/datepicker.js

index d4d9d397a9a2c70fe3466286862541624a5457f6..8faf67babb24127f4311add6a1c2c4821d942ef7 100644 (file)
@@ -56,17 +56,15 @@ var widget = $.widget( "ui.datepicker", {
                "min", "numberOfMonths", "showWeek" ],
 
        _create: function() {
-               var globalize;
                this.suppressExpandOnFocus = false;
 
                this._setLocale( this.options.locale );
 
-               // FIXME: can we use Date instead?
                if ( $.type( this.options.max ) === "string" ) {
-                       this.options.max = globalize.parseDate( this.options.max , { pattern: "yyyy-MM-dd" } );
+                       this.options.max = this.options.locale.parseYMD( this.options.max );
                }
                if ( $.type( this.options.min ) === "string" ) {
-                       this.options.min = globalize.parseDate( this.options.min , { pattern: "yyyy-MM-dd" } );
+                       this.options.min = this.options.locale.parseYMD( this.options.min );
                }
 
                this._createCalendar();
@@ -293,6 +291,9 @@ var widget = $.widget( "ui.datepicker", {
                                },
                                parse: function( stringDate ) {
                                        return globalize.parseDate( stringDate, { date: "short" } );
+                               },
+                               parseYMD: function( stringDate ) {
+                                       return globalize.parseDate( stringDate, { pattern: "yyyy-MM-dd" } );
                                }
                        };
                }