diff --git a/src/components/Timeline.vue b/src/components/Timeline.vue index b5a391d..fbf1b27 100644 --- a/src/components/Timeline.vue +++ b/src/components/Timeline.vue @@ -143,7 +143,18 @@ export default class Timeline extends Vue { this.projects = []; return; } - this.projects = projects.bySkill(skill); + this.projects = projects.bySkill(skill).sort( (a, b) => { + if( b.stopped_at == null && a.stopped_at == null ){ + return b.started_at.getTime() - a.started_at.getTime() + } + if( a.stopped_at != null && b.stopped_at == null ){ + return 1; + } + if( b.stopped_at != null && a.stopped_at == null ){ + return -1; + } + return b.started_at.getTime() - a.started_at.getTime(); + }); } private mounted() {