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