viewer = new SourceViewer();
App.viewerRegion.show(viewer);
viewer.open(uuid);
- if (typeof window.drilldown.period === 'number') {
+ if (window.drilldown.period != null) {
viewer.on('loaded', function () {
- viewer.filterLinesByPeriod(window.drilldown.period);
+ viewer.filterLinesByDate(window.drilldown.period);
});
}
});
});
},
- filterLinesByPeriod: function (periodId) {
- var periods = this.model.get('periods'),
- period = _.find(periods, function (candidate) {
- return candidate[0] === periodId;
- });
- if (period) {
- var sinceDate = moment(period[2]).toDate();
- this.filterLines(function (line) {
- var scmDate = moment(line.scmDate).toDate();
- return scmDate >= sinceDate;
- });
- }
+ filterLinesByDate: function (date) {
+ var sinceDate = moment(date).toDate();
+ this.filterLines(function (line) {
+ var scmDate = moment(line.scmDate).toDate();
+ console.log(scmDate, sinceDate);
+ return scmDate >= sinceDate;
+ });
}
});