I have facing an issue in Javascript dates. i want to compare or match two dates and show its another array.
My Code:
var ts_hms = new Date().toISOString().
replace(/T/, ' '). // replace T with a space
replace(/\..+/, ''); // delete the dot and everything after
console.log(ts_hms); //format 2020-05-07 08:04:26
console log data (Date format)
Array1:
[2020-05-07 02:15:00]
Array2:
[2020-05-07 08:04:26, 2020-05-07 09:04:26, 2020-05-07 10:04:26]
Expected Output
Array3: [same data are shows here]
Remember: dates value are changes (it is not fixed value)
Array1:
[2020-05-07 04:15:00]
Array2:
[2020-05-07 06:04:26, 2020-05-07 07:14:26, 2020-05-07 08:24:26]
How can i match two dates?
Anyone help me please?