@bbn/bbn 2.0.119 → 2.0.121
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bbn.js +1 -1
- package/dist/bbn.js.map +1 -1
- package/dist/dt/functions/parse.js +12 -3
- package/dist/dt.js +0 -1
- package/package.json +1 -1
|
@@ -329,6 +329,18 @@ export default function parse(input, format, cls = 'auto', force, locale) {
|
|
|
329
329
|
ctx.hasSecond = true;
|
|
330
330
|
}
|
|
331
331
|
},
|
|
332
|
+
{
|
|
333
|
+
token: 'ss', // PHP-like seconds
|
|
334
|
+
regex: '\\d{2}',
|
|
335
|
+
apply: (v, ctx) => {
|
|
336
|
+
const n = parseInt(v, 10);
|
|
337
|
+
if (n < 0 || n > 59) {
|
|
338
|
+
throw new Error('Invalid second: ' + n);
|
|
339
|
+
}
|
|
340
|
+
ctx.second = n;
|
|
341
|
+
ctx.hasSecond = true;
|
|
342
|
+
}
|
|
343
|
+
},
|
|
332
344
|
{
|
|
333
345
|
token: 's', // PHP-like seconds
|
|
334
346
|
regex: '\\d{2}',
|
|
@@ -535,9 +547,6 @@ export default function parse(input, format, cls = 'auto', force, locale) {
|
|
|
535
547
|
input = inputDate.format(fmt);
|
|
536
548
|
isValid = false;
|
|
537
549
|
match = fullRegex.exec(input);
|
|
538
|
-
if (!match) {
|
|
539
|
-
debugger;
|
|
540
|
-
}
|
|
541
550
|
}
|
|
542
551
|
else {
|
|
543
552
|
throw new Error(`Date string "${input}" does not match format "${fmt}"`);
|
package/dist/dt.js
CHANGED