Skip to content

Date Serialisation #15

@olly

Description

@olly

I was playing with js-model over the weekend and dates in models don't work as I expected they would. Objects with properties set as dates get serialised to strings and the when the object is parsed from localstorage it returns a string.

I had a quick look into the problem and it seems like a custom replacer callback for the JSON.parse and JSON.stringify is needed to fix this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions