JSFiddle - React, Tailwind, and code Playground
JavaScript
var tArray = ["09:00 AM", "05:00 PM"]
var timeString1 = new Date().toLocaleDateString() + " " + tArray[0];
var timeString2 = new Date().toLocaleDateString() + " " + tArray[1];
var currentTimeString = new Date().toLocaleDateString() + " " + "01:18 pm".toUpperCase();
//Below is the condition which is failing.
console.log(Date.parse(timeString1));