Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doesn't seem to handle dates properly on stringify #18

Open
jtraband opened this issue Jan 29, 2018 · 2 comments
Open

doesn't seem to handle dates properly on stringify #18

jtraband opened this issue Jan 29, 2018 · 2 comments

Comments

@jtraband
Copy link

No description provided.

@bjouhier
Copy link
Member

Can you post a repro?

@pennal
Copy link

pennal commented Oct 23, 2019

Here is a simple example:

let a = { date: new Date() }
let aStr = JSURL.stringify(obj);
console.log(aStr); // Prints ~(date~())

The workaround I have found is to save the type and the epoch value, like so:

let b = { type: "date", value: new Date().getTime()}
let bStr = JSURL.stringify(obj);
console.log(bStr); // Prints ~(type~'date~value~1571847257737)

Once you get the object back there is an extra step, but it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants