Skip to content
Snippets Groups Projects
Commit 1092cd7d authored by Lene Wasskog's avatar Lene Wasskog
Browse files

feat(observation): Order by observation date and id

parent ea122d8a
No related branches found
No related tags found
No related merge requests found
...@@ -113,7 +113,11 @@ ...@@ -113,7 +113,11 @@
computed: { computed: {
sortedObservations: function () { sortedObservations: function () {
this.observations.sort((a, b) => { this.observations.sort((a, b) => {
return new Date(b.timeOfObservation) - new Date(a.timeOfObservation); const timeComparison = new Date(b.timeOfObservation) - new Date(a.timeOfObservation);
if(timeComparison === 0) {
return b.observationId - a.observationId;
}
return timeComparison
}); });
return this.observations; return this.observations;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment