Is there a way to shorten the following code? It currently works for me, but it seems quite long-winded.
var str = "some title of an event here, weekday 17:00 – 18:00 o’clock, with name of a person";
var date = str.split(', ');
var time = date[1].split(' ');
var timeItems = time[1].split('–');
var startTime = timeItems[0].trim();
var endtime = timeItems[1].trim();
alert("event lasts from "startTime + " to " + endtime);
Any suggestions on how to make this more concise would be greatly appreciated. Thank you!