Adding check for invalid start/end dates in calendar feeds (javascript)