From a2e0eb920aaa41e6248e1a2f7d013997ba4f421f Mon Sep 17 00:00:00 2001 From: pheiberg Date: Sat, 13 Nov 2010 22:58:07 +0100 Subject: Datepicker: Fixed parsing of single y character for date formats. Fixes #6659 - Datepicker: Date format ymmdd not parsed correctly. --- ui/jquery.ui.datepicker.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ui') diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js index 110e9d6f8..961e1780d 100644 --- a/ui/jquery.ui.datepicker.js +++ b/ui/jquery.ui.datepicker.js @@ -983,9 +983,9 @@ $.extend(Datepicker.prototype, { }; // Extract a number from the string value var getNumber = function(match) { - lookAhead(match); + var isDoubled = lookAhead(match); var size = (match == '@' ? 14 : (match == '!' ? 20 : - (match == 'y' ? 4 : (match == 'o' ? 3 : 2)))); + (match == 'y' && isDoubled ? 4 : (match == 'o' ? 3 : 2)))); var digits = new RegExp('^\\d{1,' + size + '}'); var num = value.substring(iValue).match(digits); if (!num) -- cgit v1.2.3