refactors getDateField