Skip to content

Commit

Permalink
VisTimeline: optimize event sorting.
Browse files Browse the repository at this point in the history
Converting Date objects to string then comparing them is not much of a
good idea.
  • Loading branch information
ishitatsuyuki committed May 30, 2022
1 parent 360a1dc commit 0cf0cec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/visualizations/VisTimeline.vue
Expand Up @@ -108,7 +108,7 @@ export default {
events = _.filter(events, e => e.duration > 1);
console.log(`Filtered ${bucket.events.length - events.length} events`);
}
events = _.sortBy(events, e => e.timestamp);
events.sort((a, b) => a.timestamp.valueOf() - b.timestamp.valueOf());
_.each(events, e => {
data.push([
bucket.id,
Expand Down

0 comments on commit 0cf0cec

Please sign in to comment.