feat: sort projects by end date
priority (first to last) - still active with last start date - still active - ended last
This commit is contained in:
parent
fe4af9ea62
commit
a9022a02dd
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue