From b6d74367561f5508e72691277e18b6a9d919144e Mon Sep 17 00:00:00 2001 From: Rafael Xavier de Souza Date: Thu, 4 Sep 2014 15:47:48 -0300 Subject: [PATCH] (fix) Datepicker: Use Globalize 1.0.0 - parseYMD --- ui/datepicker.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ui/datepicker.js b/ui/datepicker.js index d4d9d397a..8faf67bab 100644 --- a/ui/datepicker.js +++ b/ui/datepicker.js @@ -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" } ); } }; } -- 2.39.5