rewrote date parser