Sort tab data by timestamp in descending order
This commit is contained in:
parent
b22d683d4f
commit
a49e2bcaad
1 changed files with 13 additions and 0 deletions
|
@ -64,6 +64,19 @@ module.exports = Mn.View.extend({
|
||||||
const eventLevels = ["action item"];
|
const eventLevels = ["action item"];
|
||||||
const tab3Data = response.filter(item => eventLevels.includes(item.eventLevel.trim().toLowerCase()));
|
const tab3Data = response.filter(item => eventLevels.includes(item.eventLevel.trim().toLowerCase()));
|
||||||
|
|
||||||
|
// Sort the data for each tab by timestamp in descending order.
|
||||||
|
tab1Data.sort((a, b) => {
|
||||||
|
return new Date(b.eventTime) - new Date(a.eventTime);
|
||||||
|
});
|
||||||
|
|
||||||
|
tab2Data.sort((a, b) => {
|
||||||
|
return new Date(b.eventTime) - new Date(a.eventTime);
|
||||||
|
});
|
||||||
|
|
||||||
|
tab3Data.sort((a, b) => {
|
||||||
|
return new Date(b.eventTime) - new Date(a.eventTime);
|
||||||
|
});
|
||||||
|
|
||||||
// Store the lengths of the original collections
|
// Store the lengths of the original collections
|
||||||
this.tabCollectionLengths = {
|
this.tabCollectionLengths = {
|
||||||
tab1: response.length,
|
tab1: response.length,
|
||||||
|
|
Loading…
Reference in a new issue