@bbn/bbn 2.0.19 → 2.0.21
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 +10 -10
- package/dist/date.js +31 -10
- package/package.json +1 -1
package/dist/date.d.ts
CHANGED
|
@@ -26,13 +26,13 @@ declare class bbnDateTool {
|
|
|
26
26
|
parse(input: string, format: string): bbnDateTool;
|
|
27
27
|
matchFormat(value: any, format: string): boolean;
|
|
28
28
|
toString(): string;
|
|
29
|
-
year(v?:
|
|
30
|
-
month(v?:
|
|
31
|
-
day(v?:
|
|
32
|
-
hour(v?:
|
|
33
|
-
minute(v?:
|
|
34
|
-
second(v?:
|
|
35
|
-
weekday(v?:
|
|
29
|
+
year(v?: any): number | bbnDateTool;
|
|
30
|
+
month(v?: any): number | bbnDateTool;
|
|
31
|
+
day(v?: any): number | bbnDateTool;
|
|
32
|
+
hour(v?: any): number | bbnDateTool;
|
|
33
|
+
minute(v?: any): number | bbnDateTool;
|
|
34
|
+
second(v?: any): number | bbnDateTool;
|
|
35
|
+
weekday(v?: any, past?: boolean): number | bbnDateTool;
|
|
36
36
|
/**
|
|
37
37
|
* Returns the ISO-8601 week number of this date.
|
|
38
38
|
* Week starts on Monday, and week 1 is the week with Jan 4.
|
|
@@ -69,9 +69,9 @@ declare class bbnDateTool {
|
|
|
69
69
|
add(value: number, unit?: string): bbnDateTool | null;
|
|
70
70
|
subtract(value: number, unit?: string): bbnDateTool;
|
|
71
71
|
dateFromFormat(value: string, unit: string | null): Date;
|
|
72
|
-
date(v
|
|
73
|
-
datetime(v
|
|
74
|
-
time(v
|
|
72
|
+
date(v?: any): string | bbnDateTool;
|
|
73
|
+
datetime(v?: any): string | bbnDateTool;
|
|
74
|
+
time(v?: any): string | bbnDateTool;
|
|
75
75
|
fdate(long?: boolean, withTime?: boolean, weekday?: boolean): string;
|
|
76
76
|
ftime(withSeconds?: boolean): string;
|
|
77
77
|
format(format?: string): string;
|
package/dist/date.js
CHANGED
|
@@ -850,7 +850,10 @@ class bbnDateTool {
|
|
|
850
850
|
return __classPrivateFieldGet(this, _bbnDateTool_value, "f") ? this.format() : '';
|
|
851
851
|
}
|
|
852
852
|
year(v) {
|
|
853
|
-
if (
|
|
853
|
+
if (!__classPrivateFieldGet(this, _bbnDateTool_value, "f")) {
|
|
854
|
+
return undefined;
|
|
855
|
+
}
|
|
856
|
+
if (0 in arguments && (v !== undefined) && !(v instanceof Event)) {
|
|
854
857
|
const d = this.copy();
|
|
855
858
|
d.setFullYear(v);
|
|
856
859
|
return new bbnDateTool(d);
|
|
@@ -858,7 +861,10 @@ class bbnDateTool {
|
|
|
858
861
|
return __classPrivateFieldGet(this, _bbnDateTool_value, "f").getFullYear();
|
|
859
862
|
}
|
|
860
863
|
month(v) {
|
|
861
|
-
if (
|
|
864
|
+
if (!__classPrivateFieldGet(this, _bbnDateTool_value, "f")) {
|
|
865
|
+
return undefined;
|
|
866
|
+
}
|
|
867
|
+
if (0 in arguments && (v !== undefined) && !(v instanceof Event)) {
|
|
862
868
|
const d = this.copy();
|
|
863
869
|
d.setMonth(v - 1);
|
|
864
870
|
return new bbnDateTool(d);
|
|
@@ -866,7 +872,10 @@ class bbnDateTool {
|
|
|
866
872
|
return __classPrivateFieldGet(this, _bbnDateTool_value, "f").getMonth() + 1;
|
|
867
873
|
}
|
|
868
874
|
day(v) {
|
|
869
|
-
if (
|
|
875
|
+
if (!__classPrivateFieldGet(this, _bbnDateTool_value, "f")) {
|
|
876
|
+
return undefined;
|
|
877
|
+
}
|
|
878
|
+
if (0 in arguments && (v !== undefined) && !(v instanceof Event)) {
|
|
870
879
|
const d = this.copy();
|
|
871
880
|
d.setDate(v);
|
|
872
881
|
return new bbnDateTool(d);
|
|
@@ -874,7 +883,10 @@ class bbnDateTool {
|
|
|
874
883
|
return __classPrivateFieldGet(this, _bbnDateTool_value, "f").getDate();
|
|
875
884
|
}
|
|
876
885
|
hour(v) {
|
|
877
|
-
if (
|
|
886
|
+
if (!__classPrivateFieldGet(this, _bbnDateTool_value, "f")) {
|
|
887
|
+
return undefined;
|
|
888
|
+
}
|
|
889
|
+
if (0 in arguments && (v !== undefined) && !(v instanceof Event)) {
|
|
878
890
|
const d = this.copy();
|
|
879
891
|
d.setHours(v);
|
|
880
892
|
return new bbnDateTool(d);
|
|
@@ -882,7 +894,10 @@ class bbnDateTool {
|
|
|
882
894
|
return __classPrivateFieldGet(this, _bbnDateTool_value, "f").getHours();
|
|
883
895
|
}
|
|
884
896
|
minute(v) {
|
|
885
|
-
if (
|
|
897
|
+
if (!__classPrivateFieldGet(this, _bbnDateTool_value, "f")) {
|
|
898
|
+
return undefined;
|
|
899
|
+
}
|
|
900
|
+
if (0 in arguments && (v !== undefined) && !(v instanceof Event)) {
|
|
886
901
|
const d = this.copy();
|
|
887
902
|
d.setMinutes(v);
|
|
888
903
|
return new bbnDateTool(d);
|
|
@@ -890,7 +905,10 @@ class bbnDateTool {
|
|
|
890
905
|
return __classPrivateFieldGet(this, _bbnDateTool_value, "f").getMinutes();
|
|
891
906
|
}
|
|
892
907
|
second(v) {
|
|
893
|
-
if (
|
|
908
|
+
if (!__classPrivateFieldGet(this, _bbnDateTool_value, "f")) {
|
|
909
|
+
return undefined;
|
|
910
|
+
}
|
|
911
|
+
if (0 in arguments && (v !== undefined) && !(v instanceof Event)) {
|
|
894
912
|
const d = this.copy();
|
|
895
913
|
d.setSeconds(v);
|
|
896
914
|
return new bbnDateTool(d);
|
|
@@ -898,7 +916,10 @@ class bbnDateTool {
|
|
|
898
916
|
return __classPrivateFieldGet(this, _bbnDateTool_value, "f").getSeconds();
|
|
899
917
|
}
|
|
900
918
|
weekday(v, past = false) {
|
|
901
|
-
if (
|
|
919
|
+
if (!__classPrivateFieldGet(this, _bbnDateTool_value, "f")) {
|
|
920
|
+
return undefined;
|
|
921
|
+
}
|
|
922
|
+
if (0 in arguments && (v !== undefined) && !(v instanceof Event)) {
|
|
902
923
|
return this.setWeekday(v, past);
|
|
903
924
|
}
|
|
904
925
|
return __classPrivateFieldGet(this, _bbnDateTool_value, "f").getDay();
|
|
@@ -1068,19 +1089,19 @@ class bbnDateTool {
|
|
|
1068
1089
|
return d;
|
|
1069
1090
|
}
|
|
1070
1091
|
date(v) {
|
|
1071
|
-
if (v) {
|
|
1092
|
+
if (0 in arguments && (v !== undefined) && !(v instanceof Event)) {
|
|
1072
1093
|
return this.parse(v, 'Y-m-d');
|
|
1073
1094
|
}
|
|
1074
1095
|
return this.format('Y-m-d');
|
|
1075
1096
|
}
|
|
1076
1097
|
datetime(v) {
|
|
1077
|
-
if (v) {
|
|
1098
|
+
if (0 in arguments && (v !== undefined) && !(v instanceof Event)) {
|
|
1078
1099
|
return this.parse(v, 'Y-m-d H:i:s');
|
|
1079
1100
|
}
|
|
1080
1101
|
return this.format('Y-m-d H:i:s');
|
|
1081
1102
|
}
|
|
1082
1103
|
time(v) {
|
|
1083
|
-
if (v) {
|
|
1104
|
+
if (0 in arguments && (v !== undefined) && !(v instanceof Event)) {
|
|
1084
1105
|
return this.parse(v, 'H:i:s');
|
|
1085
1106
|
}
|
|
1086
1107
|
return this.format('H:i:s');
|