From 1c13315ccee87159814f4501160ee7f59a4d17ab Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Sat, 18 Jan 2014 00:23:39 +0100 Subject: [PATCH] Transform date of contributions in timestamp on export --- inc/myco_objects.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/inc/myco_objects.js b/inc/myco_objects.js index 1d8cfcc..5cdd5bd 100644 --- a/inc/myco_objects.js +++ b/inc/myco_objects.js @@ -311,6 +311,9 @@ function Contribution(contributor,cost,title,date,uuid,lastChange) { this.contributor=contributor; this.cost=cost; this.title=title; + if (jQuery.type(date)!='date') { + date=moment(date).toDate(); + } this.date=date; this.uuid=uuid || generate_uuid(); this.lastChange=lastChange || new Date().getTime(); @@ -320,7 +323,7 @@ function Contribution(contributor,cost,title,date,uuid,lastChange) { 'uuid': this.uuid, 'cost': this.cost, 'title': encodeURIComponent(this.title), - 'date': this.date, + 'date': this.date.getTime(), 'lastChange': this.lastChange, }; }