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

Convert strings formatted as date-time to Date objects? #54

Open
rolodato opened this issue Jan 5, 2017 · 0 comments
Open

Convert strings formatted as date-time to Date objects? #54

rolodato opened this issue Jan 5, 2017 · 0 comments

Comments

@rolodato
Copy link

rolodato commented Jan 5, 2017

Hi @mac-, would you accept a PR to automatically convert strings defined with date-time formats to Date object? This is useful, for example, when saving Date objects to MongoDB - otherwise they are persisted as strings by default.

Current behavior is here:

convertValueFromStringToType = function(value, type) {

Seems this would be a breaking change. The only other JSON schema string format that has an equivalent Node type is uri, which we might want to convert automatically as well. Let me know what you think.

Thanks!

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

No branches or pull requests

1 participant