[#135,view/timeline][s]: switch to using momentjs for date parsing.
This commit is contained in:
@@ -79,13 +79,16 @@ my.Timeline = Backbone.View.extend({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
this.model.currentDocuments.each(function(doc) {
|
this.model.currentDocuments.each(function(doc) {
|
||||||
var tlEntry = {
|
var start = doc.get(self.state.get('startField'));
|
||||||
"startDate": doc.get(self.state.get('startField')),
|
if (start) {
|
||||||
"endDate": doc.get(self.state.get('endField')) || null,
|
var end = moment(doc.get(self.state.get('endField')));
|
||||||
"headline": String(doc.get(self.model.fields.models[0].id)),
|
end = end ? end.toDate() : null;
|
||||||
"text": ''
|
var tlEntry = {
|
||||||
};
|
"startDate": moment(start).toDate(),
|
||||||
if (tlEntry.startDate) {
|
"endDate": end,
|
||||||
|
"headline": String(doc.get(self.model.fields.models[0].id)),
|
||||||
|
"text": ''
|
||||||
|
};
|
||||||
out.timeline.date.push(tlEntry);
|
out.timeline.date.push(tlEntry);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user