user %!s(int64=6) %!d(string=hai) anos
pai
achega
48559e0d71
Modificáronse 5 ficheiros con 13 adicións e 13 borrados
  1. 3 3
      lib/contact-item.js
  2. 1 1
      lib/contact-item.js.map
  3. 3 3
      lib/contact-params.d.ts
  4. 3 3
      src/contact-item.ts
  5. 3 3
      src/contact-params.ts

+ 3 - 3
lib/contact-item.js

@@ -11,9 +11,9 @@ class ContactItem {
         this.alternateNames = props.alternateNames || [];
         this.name = props.name || '';
         this.me = props.me;
-        this.lastSent = props.lastSent;
-        this.lastReceived = props.lastReceived;
-        this.lastChanged = props.lastChanged;
+        this.lastSent = props.lastSent ? new Date(props.lastSent) : undefined;
+        this.lastReceived = props.lastReceived ? new Date(props.lastReceived) : undefined;
+        this.lastChanged = props.lastChanged ? new Date(props.lastChanged) : undefined;
         this.notes = props.notes || '';
     }
     matchesGroup(group) {

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
lib/contact-item.js.map


+ 3 - 3
lib/contact-params.d.ts

@@ -7,7 +7,7 @@ export interface ContactParams {
     groups: string[];
     alternateNames: string[];
     notes: string;
-    lastSent?: Date;
-    lastReceived?: Date;
-    lastChanged?: Date;
+    lastSent?: string;
+    lastReceived?: string;
+    lastChanged?: string;
 }

+ 3 - 3
src/contact-item.ts

@@ -26,9 +26,9 @@ export class ContactItem {
     this.alternateNames = props.alternateNames || [];
     this.name = props.name || '';
     this.me = props.me;
-    this.lastSent = props.lastSent;
-    this.lastReceived = props.lastReceived;
-    this.lastChanged = props.lastChanged;
+    this.lastSent = props.lastSent ? new Date(props.lastSent) : undefined;
+    this.lastReceived = props.lastReceived ? new Date(props.lastReceived) : undefined;
+    this.lastChanged = props.lastChanged ? new Date(props.lastChanged) : undefined;
     this.notes = props.notes || '';
   }
 

+ 3 - 3
src/contact-params.ts

@@ -7,7 +7,7 @@ export interface ContactParams {
     groups: string[];
     alternateNames: string[];
     notes: string;
-    lastSent?: Date;
-    lastReceived?: Date;
-    lastChanged?: Date;
+    lastSent?: string;
+    lastReceived?: string;
+    lastChanged?: string;
 }