Refactor ymdToDate to use String.split.