Implemented sort for records
This commit is contained in:
parent
daf542c527
commit
04c9b7b55f
@ -97,7 +97,7 @@ export default {
|
||||
var min = time % 60;
|
||||
record.duration = hours + "h " + min + "min";
|
||||
var start = record.startdate;
|
||||
|
||||
records[index].completeStartDate = start;
|
||||
start = start.split("T");
|
||||
records[index].startdate = start[1];
|
||||
records[index].date = start[0];
|
||||
@ -110,6 +110,11 @@ export default {
|
||||
records[index].enddate = "pending";
|
||||
}
|
||||
}
|
||||
records.sort(function(a, b) {
|
||||
a = new Date(a.completeStartDate);
|
||||
b = new Date(b.completeStartDate);
|
||||
return a>b ? -1 : a<b ? 1 : 0;
|
||||
});
|
||||
this.timeRecords = records;
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user