We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d580a94 + b076d9d commit 65054e2Copy full SHA for 65054e2
fecha.js
@@ -188,7 +188,8 @@
188
d.isPm = true;
189
}
190
}],
191
- ZZ: [/[\+\-]\d\d:?\d\d/, function (d, v) {
+ ZZ: [/([\+\-]\d\d:?\d\d|Z)/, function (d, v) {
192
+ if (v === 'Z') v = '+00:00';
193
var parts = (v + '').match(/([\+\-]|\d\d)/gi), minutes;
194
195
if (parts) {
test.js
@@ -46,6 +46,7 @@ testParse('milliseconds medium', '10:20:30.12', 'HH:mm:ss.SS', new Date(year, 0,
46
testParse('milliseconds short', '10:20:30.1', 'HH:mm:ss.S', new Date(year, 0, 1, 10, 20, 30, 100));
47
testParse('timezone offset', '09:20:31 GMT-0500 (EST)', 'HH:mm:ss ZZ', new Date(Date.UTC(year, 0, 1, 14, 20, 31)));
48
testParse('UTC timezone offset', '09:20:31 GMT-0000 (UTC)', 'HH:mm:ss ZZ', new Date(Date.UTC(year, 0, 1, 9, 20, 31)));
49
+testParse('UTC timezone offset without explicit offset', '09:20:31 Z', 'HH:mm:ss ZZ', new Date(Date.UTC(year, 0, 1, 9, 20, 31)));
50
testParse('UTC timezone offset without GMT', '09:20:31 -0000 (UTC)', 'HH:mm:ss ZZ', new Date(Date.UTC(year, 0, 1, 9, 20, 31)));
51
testParse('invalid date', 'hello', 'HH:mm:ss ZZ', false);
52
test('i18n month short parse', function() {
0 commit comments