Why do dates not enter (sort) correctly?