Commit d6b84134 authored by Floyd Hightower's avatar Floyd Hightower

Improving UI and sorting based on name and then date

parent b8940504
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
<li *ngFor="let result of datastore.results">{{ result.name }}: {{ result.message }}</li> <li *ngFor="let result of datastore.results">{{ result.name }}: {{ result.message }}</li>
</ul> </ul>
<button class="button" (click)="clearResults()">Clear results</button> <button class="button secondary" (click)="clearResults()">Clear results</button>
<br><br> <br><br>
Refreshing results in {{ seconds }} seconds. Refreshing results in {{ seconds }} seconds.
<br> <br><br>
Impatient? <a (click)="seconds = 0; countDown();">Refresh now</a>. Impatient? <a (click)="seconds = 0; countDown();">Refresh now</a>.
...@@ -48,12 +48,20 @@ export class DatastoreService { ...@@ -48,12 +48,20 @@ export class DatastoreService {
date: string; date: string;
} }
) { ) {
if (a.date === b.date) { if (a.name === b.name) {
return 0; if (a.date === b.date) {
} else if (a.date > b.date) { return 0;
return 1; } else if (a.date > b.date) {
return 1;
} else {
return -1;
}
} else { } else {
return -1; if (a.name > b.name) {
return 1;
} else {
return -1;
}
} }
}); });
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment