aboutsummaryrefslogtreecommitdiffstats
path: root/ui/datepicker.js
diff options
context:
space:
mode:
authorRodrigo Menezes <rod333@gmail.com>2014-05-15 17:16:09 -0400
committerTJ VanToll <tj.vantoll@gmail.com>2014-07-14 09:34:33 -0400
commit573037423822fa04a1888e3bcc52243b9324c5e2 (patch)
tree45ed50ff3a744482edf905844a55ed0ed7f8ec68 /ui/datepicker.js
parentbef2c456cafb60951a71386ed0b21ee7f7ae65c8 (diff)
downloadjquery-ui-573037423822fa04a1888e3bcc52243b9324c5e2.tar.gz
jquery-ui-573037423822fa04a1888e3bcc52243b9324c5e2.zip
Datepicker: reject dates with two year digits when expecting 'yy'
Fixes #8353 Closes gh-1248
Diffstat (limited to 'ui/datepicker.js')
-rw-r--r--ui/datepicker.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/ui/datepicker.js b/ui/datepicker.js
index 10b7d7eb5..46b6a5f4d 100644
--- a/ui/datepicker.js
+++ b/ui/datepicker.js
@@ -1138,7 +1138,8 @@ $.extend(Datepicker.prototype, {
var isDoubled = lookAhead(match),
size = (match === "@" ? 14 : (match === "!" ? 20 :
(match === "y" && isDoubled ? 4 : (match === "o" ? 3 : 2)))),
- digits = new RegExp("^\\d{1," + size + "}"),
+ minSize = (match === "y" ? size : 1),
+ digits = new RegExp("^\\d{" + minSize + "," + size + "}"),
num = value.substring(iValue).match(digits);
if (!num) {
throw "Missing number at position " + iValue;