Fix for new handleDateFields() function