Transform date of contributions in timestamp on export
Benjamin Renard

Benjamin Renard commited on 2014-01-17 23:23:39
Showing 1 changed files, with 4 additions and 1 deletions.

... ...
@@ -311,6 +311,9 @@ function Contribution(contributor,cost,title,date,uuid,lastChange) {
311 311
   this.contributor=contributor;
312 312
   this.cost=cost;
313 313
   this.title=title;
314
+  if (jQuery.type(date)!='date') {
315
+    date=moment(date).toDate();
316
+  }
314 317
   this.date=date;
315 318
   this.uuid=uuid || generate_uuid();
316 319
   this.lastChange=lastChange || new Date().getTime();
... ...
@@ -320,7 +323,7 @@ function Contribution(contributor,cost,title,date,uuid,lastChange) {
320 323
       'uuid': this.uuid,
321 324
       'cost': this.cost,
322 325
       'title': encodeURIComponent(this.title),
323
-      'date': this.date,
326
+      'date': this.date.getTime(),
324 327
       'lastChange': this.lastChange,
325 328
     };
326 329
   }
327 330