Skip to content

[feature request][Validator] JSON date timestamps validator #11919

@lmammino

Description

@lmammino

It would be good to have a validator for JSON date timestamps (as resulting from (new Date()).toJSON() or JSON.stringify(new Date()), e.g. 2014-09-13T12:08:06.080Z)

It can be useful to validate arrays or objects resulting from the deserialization of a JSON string where some field represents a Date object.

A common use case is when you have to write a JSON rest API and you have to handle date fields coming from the request (and it's obviously good to validate these fields before using them on the server side).

I have written my own implementation for this and if it seems a good feature to integrate in the symfony core a can submit a pull request and write the related documentation.

PS: the validator can also be extended even further and support the entire ISO8601specification (eg. ISO8601DateValidator)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions