JavaScript implementation for SimpleDateFormat