@bbn/bbn 2.0.12 → 2.0.14
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/date.d.ts +1 -0
- package/dist/date.js +16 -6
- package/package.json +1 -1
package/dist/date.d.ts
CHANGED
package/dist/date.js
CHANGED
|
@@ -450,6 +450,17 @@ class bbnDateTool {
|
|
|
450
450
|
ctx.month = n;
|
|
451
451
|
}
|
|
452
452
|
},
|
|
453
|
+
{
|
|
454
|
+
token: 'mm',
|
|
455
|
+
regex: '\\d{2}',
|
|
456
|
+
apply: v => {
|
|
457
|
+
const n = parseInt(v, 10);
|
|
458
|
+
if (n < 0 || n > 59) {
|
|
459
|
+
throw new Error('Invalid minute: ' + n);
|
|
460
|
+
}
|
|
461
|
+
ctx.month = n;
|
|
462
|
+
}
|
|
463
|
+
},
|
|
453
464
|
{
|
|
454
465
|
token: 'M',
|
|
455
466
|
regex: '\\d{1,2}',
|
|
@@ -776,12 +787,7 @@ class bbnDateTool {
|
|
|
776
787
|
__classPrivateFieldSet(this, _bbnDateTool_value, new Date(), "f");
|
|
777
788
|
}
|
|
778
789
|
else if (inputFormat) {
|
|
779
|
-
|
|
780
|
-
__classPrivateFieldSet(this, _bbnDateTool_value, bbnDateTool.parse(value, inputFormat), "f");
|
|
781
|
-
}
|
|
782
|
-
catch (e) {
|
|
783
|
-
throw new Error('Error parsing date with format "' + inputFormat + '": ' + e.message);
|
|
784
|
-
}
|
|
790
|
+
__classPrivateFieldSet(this, _bbnDateTool_value, bbnDateTool.parse(value, inputFormat), "f");
|
|
785
791
|
}
|
|
786
792
|
else {
|
|
787
793
|
if (t === 'number' || (isNumber(value) && value !== '')) {
|
|
@@ -984,6 +990,10 @@ class bbnDateTool {
|
|
|
984
990
|
const i = parseInt(this.minute().toString());
|
|
985
991
|
return i < 10 ? '0' + i.toString() : i.toString();
|
|
986
992
|
}
|
|
993
|
+
get mm() {
|
|
994
|
+
const i = parseInt(this.minute().toString());
|
|
995
|
+
return i < 10 ? '0' + i.toString() : i.toString();
|
|
996
|
+
}
|
|
987
997
|
get I() {
|
|
988
998
|
return this.minute().toString();
|
|
989
999
|
}
|