mybase 1.1.37 → 1.1.38
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/package.json
CHANGED
package/ts/models/Timespan.d.ts
CHANGED
package/ts/models/Timespan.js
CHANGED
|
@@ -47,6 +47,12 @@ class Timespan {
|
|
|
47
47
|
static months(months) {
|
|
48
48
|
return new Timespan(months * 30 * 24 * 60 * 60 * 1000);
|
|
49
49
|
}
|
|
50
|
+
toJSON() {
|
|
51
|
+
return {
|
|
52
|
+
__type: 'Timespan',
|
|
53
|
+
value: this.ms
|
|
54
|
+
};
|
|
55
|
+
}
|
|
50
56
|
}
|
|
51
57
|
exports.Timespan = Timespan;
|
|
52
58
|
//# sourceMappingURL=Timespan.js.map
|
package/ts/models/Timespan.ts
CHANGED
package/ts/models/Unixtime.d.ts
CHANGED
|
@@ -8,6 +8,10 @@ export declare class Unixtime {
|
|
|
8
8
|
isEmpty(): boolean;
|
|
9
9
|
lessThan(other: Unixtime): boolean;
|
|
10
10
|
get elapsed(): Timespan;
|
|
11
|
+
toJSON(): {
|
|
12
|
+
__type: string;
|
|
13
|
+
value: number;
|
|
14
|
+
};
|
|
11
15
|
constructor(value: Date | string | number);
|
|
12
16
|
addTimespan(timespan: Timespan): Unixtime;
|
|
13
17
|
subtractTimespan(timespan: Timespan): Unixtime;
|
package/ts/models/Unixtime.js
CHANGED
|
@@ -22,6 +22,12 @@ class Unixtime {
|
|
|
22
22
|
get elapsed() {
|
|
23
23
|
return new Timespan_1.Timespan(Date.now() - this.toLongUnixtime());
|
|
24
24
|
}
|
|
25
|
+
toJSON() {
|
|
26
|
+
return {
|
|
27
|
+
__type: 'Unixtime',
|
|
28
|
+
value: this.toLongUnixtime()
|
|
29
|
+
};
|
|
30
|
+
}
|
|
25
31
|
constructor(value) {
|
|
26
32
|
if (typeof value === 'string') {
|
|
27
33
|
this.value = new Date(value);
|
package/ts/models/Unixtime.ts
CHANGED
|
@@ -31,6 +31,13 @@ export class Unixtime {
|
|
|
31
31
|
return new Timespan(Date.now() - this.toLongUnixtime())
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
toJSON() {
|
|
35
|
+
return {
|
|
36
|
+
__type:'Unixtime',
|
|
37
|
+
value:this.toLongUnixtime()
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
34
41
|
|
|
35
42
|
constructor(value: Date | string | number) {
|
|
36
43
|
if (typeof value === 'string') {
|