added error logging and rendering for invalid dates