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, }; }