-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode.js
More file actions
33 lines (32 loc) · 688 Bytes
/
Copy pathcode.js
File metadata and controls
33 lines (32 loc) · 688 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
var aryData =[
{
"id":1,
"start":"2023-12-07T13:00:00",
"subject":"Message 4",
},
{
"id":2,
"start":"2023-12-07T09:00:00",
"subject":"Message 2",
},
{
"id":3,
"start":"2023-12-07T10:00:00",
"subject":"Message 3",
},
{
"id":4,
"start":"2023-12-07T07:00:00",
"subject":"Message 1",
},
{
"id":5,
"start":"2023-12-07T14:00:00",
"subject":"Message 5",
}
];
function comp(a, b) {
return new Date(a.start).getTime() - new Date(b.start).getTime();
}
aryData.sort(comp);
console.log(aryData);