From: Tim Perry Date: Tue, 17 Dec 2013 17:47:30 +0000 (+0000) Subject: Make colon in ISO timezone format acceptable only when minutes are specified (+01... X-Git-Tag: 2.5.0^2~5^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4589e67de75ae2294b4b9146377c1c3b52af891;p=thirdparty%2Fmoment.git Make colon in ISO timezone format acceptable only when minutes are specified (+01:00 good, +01: bad) --- diff --git a/moment.js b/moment.js index 2e54c853d..4b26de3d0 100644 --- a/moment.js +++ b/moment.js @@ -62,7 +62,7 @@ // iso 8601 regex // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) - isoRegex = /^\s*\d{4}-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d:?(?:\d\d)?|\s*Z)?)?$/, + isoRegex = /^\s*\d{4}-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/, isoFormat = 'YYYY-MM-DDTHH:mm:ssZ',