Parse Event Time From String Javascript

I am working on some code to parse event times from messy input use strings. The idea is to find the time and output the start and end time.

I have developed some code, that needs more tweaks, but I am trying to develop it so it can look for various types of user inputs for example:

7-8am
7:00 till 8:00 p.m.
Even starts at 8:00 a.m. and ends at 7:00 p.m.

Please feel free to use the code or give suggestions on how to tweak my javascript to make faster. I am sure I over-engineered it in more than one way.


var re = /(a.m.|p.m.|pm|am)/g, // Filter By
str = "String blab la bla $22.99 event starts at 12:41 a.m. ends at 10:00 p.m. asdfasdfas"; // String To Test

var timeArray = new Array();
var timeStamp = new Array();

while ((matcher = re.exec(str)) != null) {
timeArray.push(matcher.index);
timeStamp.push(matcher[0]);
}

// Get Start And End Time
startTime = str.substring(timeArray[0] - 6, timeArray[0]);
finishTime = str.substring(timeArray[1] - 13, timeArray[1]);

if (startTime.length == 2) {
finishTime = startTime.substr(1,2);
startTime = startTime.slice(0,1);
} else {
// console.log(finishTime);
// console.log(startTime);

var matches = /(-|to|till)/g;

if (finishTime.match(matches) != null) {

var splitTime = startTime.split( matches );
var slpitTimeFinish = finishTime.split( matches );

if (timeStamp.length > 1) {
finishTime = slpitTimeFinish[2].replace(/[A-Za-z$.]/g, "");
startTime = splitTime[0].replace(/[A-Za-z$.]/g, "");
startTime = startTime.replace(/[0-9]{1,3}\s/g, "");

} else {

finishTime = slpitTimeFinish[2].replace(/[A-Za-z$.]/g, "");
startTime = slpitTimeFinish[0].replace(/[A-Za-z$.]/g, "");

var breakTime = startTime.split(':')
hours = breakTime[0].replace(/[0-9]{1,4}\s/g, "");
minutes = breakTime[1];

if (minutes == null) {
startTime = hours + ":00";
} else {
startTime = hours + ":" + minutes;
}

}

startTime = startTime.replace(/\s+/g, ''); // Remove Spaces
finishTime = finishTime.replace(/\s+/g, ''); // Remove Spaces

} else {
finishTime = finishTime.replace(/[A-Za-z$.]/g, "");
// console.log(finishTime);

var breakTime = finishTime.split(':')
hours = breakTime[0].replace(/[0-9]{1,4}\s/g, "");
minutes = breakTime[1];

if (minutes == null) {
finishTime = hours + ":00";
} else {
finishTime = hours + ":" + minutes;
}

finishTime = finishTime.replace(/\s+/g, ''); // Remove Spaces
// console.log(finishTime);

startTime = startTime.replace(/[A-Za-z$.]/g, "");

var breakTime = startTime.split(':')
hours = breakTime[0].replace(/[0-9]{1,4}\s/g, "");
minutes = breakTime[1];

if (minutes == null) {
startTime = hours + ":00";
} else {
startTime = hours + ":" + minutes;
}

startTime = startTime.replace(/\s+/g, ''); // Remove Spaces

}
}

// Get Time Stamp

if (timeStamp.length > 1) {
eventStartStamp = timeStamp[0];
eventEndStamp = timeStamp[1];
} else {
eventStartStamp = timeStamp[0];
eventEndStamp = timeStamp[0];
}

console.log ("Event Starts At "+ startTime + " " + eventStartStamp +" Ends At "+ finishTime + " " + eventEndStamp );