mybase 1.1.38 → 1.1.39

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mybase",
3
- "version": "1.1.38",
3
+ "version": "1.1.39",
4
4
  "description": "",
5
5
  "main": "mybase.js",
6
6
  "scripts": {
@@ -15,6 +15,8 @@ export declare class Timespan {
15
15
  static days(days: number): Timespan;
16
16
  static weeks(weeks: number): Timespan;
17
17
  static months(months: number): Timespan;
18
+ add(timespan: Timespan): Timespan;
19
+ subtract(timespan: Timespan): Timespan;
18
20
  toJSON(): {
19
21
  __type: string;
20
22
  value: number;
@@ -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
+ add(timespan) {
51
+ return new Timespan(this.ms + timespan.ms);
52
+ }
53
+ subtract(timespan) {
54
+ return new Timespan(this.ms - timespan.ms);
55
+ }
50
56
  toJSON() {
51
57
  return {
52
58
  __type: 'Timespan',
@@ -58,6 +58,14 @@ export class Timespan {
58
58
  return new Timespan(months * 30 * 24 * 60 * 60 * 1000)
59
59
  }
60
60
 
61
+ add(timespan: Timespan): Timespan {
62
+ return new Timespan(this.ms + timespan.ms)
63
+ }
64
+
65
+ subtract(timespan: Timespan): Timespan {
66
+ return new Timespan(this.ms - timespan.ms)
67
+ }
68
+
61
69
 
62
70
  toJSON() {
63
71
  return {