How do I filter date-ranges based on whether they include a specific date?
let visitors = [{
"S.NO": 1,
"Full Name": "Boss",
"Check In": "2020-04-21 01:51:49",
"Check Out": ""
}, {
"S.NO": 2,
"Full Name": "John",
"Check In": "2020-04-19 11:21:17",
"Check Out": "2020-04-19 12:21:26"
}, {
"S.NO": 3,
"Full Name": "Doll",
"Check In": "2020-04-02 11:19:48",
"Check Out": "2020-04-02 15:19:58"
}];
I want to filter the data above by the following date:
let knowntime = "2020-04-02 13:20:22";
This is the result I'm looking for:
let filtered = [{
"S.NO": 3,
"Full Name": "Doll",
"Check In": "2020-04-02 11:19:48",
"Check Out": "2020-04-02 15:19:58"
}];
How do I do that?