]> source.dussan.org Git - jquery-ui.git/commitdiff
Datepicker - Fixed #4956 - undefined variable: lookAhead()
authorKeith Wood <kbwood.au@gmail.com>
Fri, 27 Nov 2009 06:17:41 +0000 (06:17 +0000)
committerKeith Wood <kbwood.au@gmail.com>
Fri, 27 Nov 2009 06:17:41 +0000 (06:17 +0000)
ui/jquery.ui.datepicker.js

index 9de0e8ce5fe96146b25afce50ce34929a325c797..db076090cdf08808266bca560ba20f29b50e30c0 100644 (file)
@@ -1157,6 +1157,13 @@ $.extend(Datepicker.prototype, {
        _possibleChars: function (format) {
                var chars = '';
                var literal = false;
+               // Check whether a format character is doubled
+               var lookAhead = function(match) {
+                       var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
+                       if (matches)
+                               iFormat++;
+                       return matches;
+               };
                for (var iFormat = 0; iFormat < format.length; iFormat++)
                        if (literal)
                                if (format.charAt(iFormat) == "'" && !lookAhead("'"))