From 8f728f90a2f61fbba0726059066a68c1de7fd836 Mon Sep 17 00:00:00 2001 From: arsnyder16 Date: Wed, 20 May 2020 14:12:47 -0400 Subject: [PATCH 01/14] update ja test to show roundtrip bug --- src/locale/ja/snapshot.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/locale/ja/snapshot.md b/src/locale/ja/snapshot.md index 4b89866264..da275d29d5 100644 --- a/src/locale/ja/snapshot.md +++ b/src/locale/ja/snapshot.md @@ -166,8 +166,8 @@ | | | 1453-05-29T23:59:59.999Z | 1453/05/29 | 1453-05-29T00:00:00.000Z | | | PPP | 1987-02-11T12:13:14.015Z | 1987 年 2 月 11 日 | 1987-02-11T00:00:00.000Z | | | | 1453-05-29T23:59:59.999Z | 1453 年 5 月 29 日 | 1453-05-29T00:00:00.000Z | -| | PPPP | 1987-02-11T12:13:14.015Z | 1987 年 2 月 11 日水曜日 | 1987-02-04T00:00:00.000Z | -| | | 1453-05-29T23:59:59.999Z | 1453 年 5 月 29 日日曜日 | 1453-05-08T00:00:00.000Z | +| | PPPP | 1987-02-11T12:13:14.015Z | 1987 年 2 月 11 日水曜日 | 1987-02-11T00:00:00.000Z | +| | | 1453-05-29T23:59:59.999Z | 1453 年 5 月 29 日日曜日 | 1453-05-29T00:00:00.000Z | | Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z | | | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z | | | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z | From 74489bcd738bf8277c7ad212389cce4df242b16e Mon Sep 17 00:00:00 2001 From: arsnyder16 Date: Wed, 20 May 2020 14:30:56 -0400 Subject: [PATCH 02/14] update ko --- src/locale/ko/snapshot.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/locale/ko/snapshot.md b/src/locale/ko/snapshot.md index 926f1ff8bd..9618884640 100644 --- a/src/locale/ko/snapshot.md +++ b/src/locale/ko/snapshot.md @@ -166,8 +166,8 @@ | | | 1453-05-29T23:59:59.999Z | 1453.05.29 | 1453-05-29T00:00:00.000Z | | | PPP | 1987-02-11T12:13:14.015Z | 1987년 2월 11일 | 1987-02-11T00:00:00.000Z | | | | 1453-05-29T23:59:59.999Z | 1453년 5월 29일 | 1453-05-29T00:00:00.000Z | -| | PPPP | 1987-02-11T12:13:14.015Z | 1987년 2월 11일 수요일 | 1987-02-04T00:00:00.000Z | -| | | 1453-05-29T23:59:59.999Z | 1453년 5월 29일 일요일 | 1453-05-01T00:00:00.000Z | +| | PPPP | 1987-02-11T12:13:14.015Z | 1987년 2월 11일 수요일 | 1987-02-11T00:00:00.000Z | +| | | 1453-05-29T23:59:59.999Z | 1453년 5월 29일 일요일 | 1453-05-29T00:00:00.000Z | | Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z | | | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z | | | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z | From 67db7a30dc60de47a748f36943420ca9cb62eec1 Mon Sep 17 00:00:00 2001 From: arsnyder16 Date: Wed, 20 May 2020 15:02:19 -0400 Subject: [PATCH 03/14] Update index.js --- src/parse/_lib/parsers/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/parse/_lib/parsers/index.js b/src/parse/_lib/parsers/index.js index c220606277..dd5039d932 100644 --- a/src/parse/_lib/parsers/index.js +++ b/src/parse/_lib/parsers/index.js @@ -866,6 +866,8 @@ var parsers = { // Day of the month d: { priority: 90, + + subPriority: 1, parse: function(string, token, match, _options) { switch (token) { @@ -914,6 +916,8 @@ var parsers = { // Day of year D: { priority: 90, + + subPriority: 1, parse: function(string, token, match, _options) { switch (token) { From 288def1da17f66b6158df88f5cb699328771e109 Mon Sep 17 00:00:00 2001 From: arsnyder16 Date: Wed, 20 May 2020 15:04:08 -0400 Subject: [PATCH 04/14] sort by sub priority --- src/parse/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/parse/index.js b/src/parse/index.js index 9460e3f769..2ca18ce4b1 100644 --- a/src/parse/index.js +++ b/src/parse/index.js @@ -556,7 +556,9 @@ export default function parse( .filter(function(setter) { return setter.priority === priority }) - .reverse() + .sort(function (a, b) { + return (b.subPriority || 0) - (a.subPriority || 0); + }) }) .map(function(setterArray) { return setterArray[0] From 86b1d384411c22f62dcd8f20864770caa5c8d1b3 Mon Sep 17 00:00:00 2001 From: arsnyder16 Date: Wed, 20 May 2020 15:49:24 -0400 Subject: [PATCH 05/14] Update index.js --- src/parse/index.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/parse/index.js b/src/parse/index.js index 2ca18ce4b1..c8aef56628 100644 --- a/src/parse/index.js +++ b/src/parse/index.js @@ -422,6 +422,7 @@ export default function parse( var setters = [ { priority: TIMEZONE_UNIT_PRIORITY, + subPriority: -1, set: dateToSystemTimezone, index: 0 } @@ -504,6 +505,7 @@ export default function parse( setters.push({ priority: parser.priority, + subPriority: parser.subPriority || 0, set: parser.set, validate: parser.validate, value: parseResult.value, @@ -548,16 +550,13 @@ export default function parse( .sort(function(a, b) { return b - a }) - .filter(function(priority, index, array) { - return array.indexOf(priority) === index - }) .map(function(priority) { return setters .filter(function(setter) { return setter.priority === priority }) - .sort(function (a, b) { - return (b.subPriority || 0) - (a.subPriority || 0); + .sort(function(a, b) { + return b.subPriority - a.subPriority }) }) .map(function(setterArray) { From 5452e39a35bc9b52cd4da25d0eef3cdba5cf0d40 Mon Sep 17 00:00:00 2001 From: arsnyder16 Date: Wed, 20 May 2020 16:16:24 -0400 Subject: [PATCH 06/14] Update index.js --- src/parse/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/parse/index.js b/src/parse/index.js index c8aef56628..42968bc5e8 100644 --- a/src/parse/index.js +++ b/src/parse/index.js @@ -550,6 +550,9 @@ export default function parse( .sort(function(a, b) { return b - a }) + .filter(function(priority, index, array) { + return array.indexOf(priority) === index + }) .map(function(priority) { return setters .filter(function(setter) { From 6c20376f887cdbe9052aefca569d2a531d145b91 Mon Sep 17 00:00:00 2001 From: arsnyder16 Date: Wed, 20 May 2020 16:16:52 -0400 Subject: [PATCH 07/14] Update index.js --- src/parse/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parse/index.js b/src/parse/index.js index 42968bc5e8..94ee50bf0c 100644 --- a/src/parse/index.js +++ b/src/parse/index.js @@ -550,8 +550,8 @@ export default function parse( .sort(function(a, b) { return b - a }) - .filter(function(priority, index, array) { - return array.indexOf(priority) === index + .filter(function(priority, index, array) { + return array.indexOf(priority) === index }) .map(function(priority) { return setters From d1053464c82dd36ad1a0e2511bbdb8189830c72e Mon Sep 17 00:00:00 2001 From: arsnyder16 Date: Wed, 20 May 2020 20:39:06 +0000 Subject: [PATCH 08/14] Update snapshot.md --- src/locale/hu/snapshot.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/locale/hu/snapshot.md b/src/locale/hu/snapshot.md index e7191bfd16..848adace96 100644 --- a/src/locale/hu/snapshot.md +++ b/src/locale/hu/snapshot.md @@ -166,8 +166,8 @@ | | | 1453-05-29T23:59:59.999Z | 1453. máj. 29. | 1453-05-29T00:00:00.000Z | | | PPP | 1987-02-11T12:13:14.015Z | 1987. február 11. | 1987-02-11T00:00:00.000Z | | | | 1453-05-29T23:59:59.999Z | 1453. május 29. | 1453-05-29T00:00:00.000Z | -| | PPPP | 1987-02-11T12:13:14.015Z | 1987. február 11., szerda | 1987-02-04T00:00:00.000Z | -| | | 1453-05-29T23:59:59.999Z | 1453. május 29., vasárnap | 1453-05-08T00:00:00.000Z | +| | PPPP | 1987-02-11T12:13:14.015Z | 1987. február 11., szerda | 1987-02-11T00:00:00.000Z | +| | | 1453-05-29T23:59:59.999Z | 1453. május 29., vasárnap | 1453-05-29T00:00:00.000Z | | Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z | | | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z | | | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z | From a3dc3586715f353890671d89146ce5423f72246b Mon Sep 17 00:00:00 2001 From: arsnyder16 Date: Wed, 20 May 2020 20:40:06 +0000 Subject: [PATCH 09/14] Update snapshot.md --- src/locale/hy/snapshot.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/locale/hy/snapshot.md b/src/locale/hy/snapshot.md index 4949cd529d..e060bbe9ed 100644 --- a/src/locale/hy/snapshot.md +++ b/src/locale/hy/snapshot.md @@ -166,8 +166,8 @@ | | | 1453-05-29T23:59:59.999Z | 29 մայ, 1453 | 1453-05-29T00:00:00.000Z | | | PPP | 1987-02-11T12:13:14.015Z | 11 փետրվար, 1987 | 1987-02-11T00:00:00.000Z | | | | 1453-05-29T23:59:59.999Z | 29 մայիս, 1453 | 1453-05-29T00:00:00.000Z | -| | PPPP | 1987-02-11T12:13:14.015Z | 11 փետրվար, 1987, չորեքշաբթի | 1987-02-04T00:00:00.000Z | -| | | 1453-05-29T23:59:59.999Z | 29 մայիս, 1453, կիրակի | 1453-05-08T00:00:00.000Z | +| | PPPP | 1987-02-11T12:13:14.015Z | 11 փետրվար, 1987, չորեքշաբթի | 1987-02-11T00:00:00.000Z | +| | | 1453-05-29T23:59:59.999Z | 29 մայիս, 1453, կիրակի | 1453-05-29T00:00:00.000Z | | Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z | | | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z | | | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z | From fcb9783429fa18f42dbd96a734bd677e53120efa Mon Sep 17 00:00:00 2001 From: arsnyder16 Date: Wed, 20 May 2020 20:40:33 +0000 Subject: [PATCH 10/14] Update snapshot.md --- src/locale/lt/snapshot.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/locale/lt/snapshot.md b/src/locale/lt/snapshot.md index 6b26091a05..368443fcfb 100644 --- a/src/locale/lt/snapshot.md +++ b/src/locale/lt/snapshot.md @@ -166,8 +166,8 @@ | | | 1453-05-29T23:59:59.999Z | 1453-05-29 | 1453-05-29T00:00:00.000Z | | | PPP | 1987-02-11T12:13:14.015Z | 1987 m. vasario 11 d. | 1987-02-11T00:00:00.000Z | | | | 1453-05-29T23:59:59.999Z | 1453 m. gegužės 29 d. | 1453-05-29T00:00:00.000Z | -| | PPPP | 1987-02-11T12:13:14.015Z | 1987 m. vasario 11 d., trečiadienį | 1987-02-04T00:00:00.000Z | -| | | 1453-05-29T23:59:59.999Z | 1453 m. gegužės 29 d., sekmadienį | 1453-05-08T00:00:00.000Z | +| | PPPP | 1987-02-11T12:13:14.015Z | 1987 m. vasario 11 d., trečiadienį | 1987-02-11T00:00:00.000Z | +| | | 1453-05-29T23:59:59.999Z | 1453 m. gegužės 29 d., sekmadienį | 1453-05-29T00:00:00.000Z | | Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z | | | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z | | | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z | From bbd27d737267cfbe7af76fa869b9c6a37304da46 Mon Sep 17 00:00:00 2001 From: arsnyder16 Date: Wed, 20 May 2020 20:41:04 +0000 Subject: [PATCH 11/14] Update snapshot.md --- src/locale/te/snapshot.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/locale/te/snapshot.md b/src/locale/te/snapshot.md index f605236d67..38452df58a 100644 --- a/src/locale/te/snapshot.md +++ b/src/locale/te/snapshot.md @@ -166,8 +166,8 @@ | | | 1453-05-29T23:59:59.999Z | 29 మే, 1453 | 1453-05-29T00:00:00.000Z | | | PPP | 1987-02-11T12:13:14.015Z | 11 ఫిబ్రవరి, 1987 | 1987-02-11T00:00:00.000Z | | | | 1453-05-29T23:59:59.999Z | 29 మే, 1453 | 1453-05-29T00:00:00.000Z | -| | PPPP | 1987-02-11T12:13:14.015Z | 11, ఫిబ్రవరి 1987, బుధవారం | 1987-02-04T00:00:00.000Z | -| | | 1453-05-29T23:59:59.999Z | 29, మే 1453, ఆదివారం | 1453-05-01T00:00:00.000Z | +| | PPPP | 1987-02-11T12:13:14.015Z | 11, ఫిబ్రవరి 1987, బుధవారం | 1987-02-11T00:00:00.000Z | +| | | 1453-05-29T23:59:59.999Z | 29, మే 1453, ఆదివారం | 1453-05-29T00:00:00.000Z | | Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 అపరాహ్నం | 1987-02-11T12:13:00.000Z | | | | 1453-05-29T23:59:59.999Z | 11:59 అపరాహ్నం | 1453-05-29T23:59:00.000Z | | | pp | 1987-02-11T12:13:14.015Z | 12:13:14 అపరాహ్నం | 1987-02-11T12:13:14.000Z | From 85e74e2273a0b95382aefe990944395ab5e82b05 Mon Sep 17 00:00:00 2001 From: arsnyder16 Date: Wed, 20 May 2020 20:41:50 +0000 Subject: [PATCH 12/14] Update snapshot.md --- src/locale/tr/snapshot.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/locale/tr/snapshot.md b/src/locale/tr/snapshot.md index c6cbe73ead..dab423ad80 100644 --- a/src/locale/tr/snapshot.md +++ b/src/locale/tr/snapshot.md @@ -166,8 +166,8 @@ | | | 1453-05-29T23:59:59.999Z | 29 May 1453 | 1453-05-29T00:00:00.000Z | | | PPP | 1987-02-11T12:13:14.015Z | 11 Şubat 1987 | 1987-02-11T00:00:00.000Z | | | | 1453-05-29T23:59:59.999Z | 29 Mayıs 1453 | 1453-05-29T00:00:00.000Z | -| | PPPP | 1987-02-11T12:13:14.015Z | 11 Şubat 1987 Çarşamba | 1987-02-04T00:00:00.000Z | -| | | 1453-05-29T23:59:59.999Z | 29 Mayıs 1453 Pazar | 1453-05-08T00:00:00.000Z | +| | PPPP | 1987-02-11T12:13:14.015Z | 11 Şubat 1987 Çarşamba | 1987-02-11T00:00:00.000Z | +| | | 1453-05-29T23:59:59.999Z | 29 Mayıs 1453 Pazar | 1453-05-29T00:00:00.000Z | | Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z | | | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z | | | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z | From e96878b47f843c6aa189433684d907c01fcf87f2 Mon Sep 17 00:00:00 2001 From: arsnyder16 Date: Wed, 20 May 2020 20:42:22 +0000 Subject: [PATCH 13/14] Update snapshot.md --- src/locale/zh-CN/snapshot.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/locale/zh-CN/snapshot.md b/src/locale/zh-CN/snapshot.md index 668d3c8317..b11b41d54e 100644 --- a/src/locale/zh-CN/snapshot.md +++ b/src/locale/zh-CN/snapshot.md @@ -166,8 +166,8 @@ | | | 1453-05-29T23:59:59.999Z | 1453-05-29 | 1453-05-29T00:00:00.000Z | | | PPP | 1987-02-11T12:13:14.015Z | 1987 年 2 月 11 日 | 1987-02-11T00:00:00.000Z | | | | 1453-05-29T23:59:59.999Z | 1453 年 5 月 29 日 | 1453-05-29T00:00:00.000Z | -| | PPPP | 1987-02-11T12:13:14.015Z | 1987 年 2 月 11 日 星期三 | 1987-02-04T00:00:00.000Z | -| | | 1453-05-29T23:59:59.999Z | 1453 年 5 月 29 日 星期日 | 1453-05-08T00:00:00.000Z | +| | PPPP | 1987-02-11T12:13:14.015Z | 1987 年 2 月 11 日 星期三 | 1987-02-11T00:00:00.000Z | +| | | 1453-05-29T23:59:59.999Z | 1453 年 5 月 29 日 星期日 | 1453-05-29T00:00:00.000Z | | Long localized time | p | 1987-02-11T12:13:14.015Z | 下午 12:13 | 1987-02-11T12:13:00.000Z | | | | 1453-05-29T23:59:59.999Z | 下午 11:59 | 1453-05-29T23:59:00.000Z | | | pp | 1987-02-11T12:13:14.015Z | 下午 12:13:14 | 1987-02-11T12:13:14.000Z | From 0ea01aade83fcde370e5ad517079cb501e1aeba8 Mon Sep 17 00:00:00 2001 From: arsnyder16 Date: Wed, 20 May 2020 20:42:47 +0000 Subject: [PATCH 14/14] Update snapshot.md --- src/locale/zh-TW/snapshot.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/locale/zh-TW/snapshot.md b/src/locale/zh-TW/snapshot.md index abf4a577dd..48f0144104 100644 --- a/src/locale/zh-TW/snapshot.md +++ b/src/locale/zh-TW/snapshot.md @@ -166,8 +166,8 @@ | | | 1453-05-29T23:59:59.999Z | 1453-05-29 | 1453-05-29T00:00:00.000Z | | | PPP | 1987-02-11T12:13:14.015Z | 1987 年 2 月 11 日 | 1987-02-11T00:00:00.000Z | | | | 1453-05-29T23:59:59.999Z | 1453 年 5 月 29 日 | 1453-05-29T00:00:00.000Z | -| | PPPP | 1987-02-11T12:13:14.015Z | 1987 年 2 月 11 日 星期三 | 1987-02-04T00:00:00.000Z | -| | | 1453-05-29T23:59:59.999Z | 1453 年 5 月 29 日 星期日 | 1453-05-08T00:00:00.000Z | +| | PPPP | 1987-02-11T12:13:14.015Z | 1987 年 2 月 11 日 星期三 | 1987-02-11T00:00:00.000Z | +| | | 1453-05-29T23:59:59.999Z | 1453 年 5 月 29 日 星期日 | 1453-05-29T00:00:00.000Z | | Long localized time | p | 1987-02-11T12:13:14.015Z | 下午 12:13 | 1987-02-11T12:13:00.000Z | | | | 1453-05-29T23:59:59.999Z | 下午 11:59 | 1453-05-29T23:59:00.000Z | | | pp | 1987-02-11T12:13:14.015Z | 下午 12:13:14 | 1987-02-11T12:13:14.000Z |