]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
[bugfix] Fix incorrect strict parsing with full-width parentheses (#4240)
authorMatthew Kendrick Co <matthewdeeco@gmail.com>
Sun, 17 Dec 2017 00:37:43 +0000 (08:37 +0800)
committerKunal Marwaha <marwahaha@berkeley.edu>
Sun, 17 Dec 2017 00:37:43 +0000 (19:37 -0500)
src/lib/parse/regex.js
src/test/locale/ja.js

index 5076548ed239b5a4aab76f4184657c76e878e5b4..4b86f34c7dd6e94da064da271f9718a912ca3aa8 100644 (file)
@@ -20,7 +20,7 @@ export var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123
 
 // any word (or two) characters or numbers including two/three word month in arabic.
 // includes scottish gaelic two word and hyphenated months
-export var matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;
+export var matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;
 
 
 import hasOwnProp from '../utils/has-own-prop';
index 2435e13a133176b6091bd6ab369974c2164859cd..f9d184a2abe1426a77735bcfb0ed37aa0458b0aa 100644 (file)
@@ -170,3 +170,6 @@ test('weeks year starting sunday format', function (assert) {
     assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 should be week 3');
 });
 
+test('parse with japanese parentheses', function (assert) {
+    assert.ok(moment('2016年5月18日(水)', 'YYYY年M月D日(dd)', true).isValid(), 'parse with japanese parentheses');
+});