JS date method work around