Cast date as JS