refactor date inboarding and sorting to use ruby Time class