only compare dates if they exist