Makes getDate return null if no value is entered