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

Add DateTime and DateTimeRange expectations #36

Open
repli2dev opened this issue Dec 15, 2020 · 2 comments
Open

Add DateTime and DateTimeRange expectations #36

repli2dev opened this issue Dec 15, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@repli2dev
Copy link

It would be handy to provide expectations for datetime too, typically validation & parsing in given format. Apart from format typically we use min and max validations as well as cross validations for intervals between two or more provided values.

@repli2dev repli2dev changed the title Add DateTime expectations Add DateTime and DateTimeRange expectations Dec 15, 2020
@dg
Copy link
Member

dg commented Dec 15, 2020

It would probably be better to make a separate class for this, like https://github.com/redbitcz/subreg-api-php/blob/60f377ac68f3c1871b926eca336f5eb8d3368455/src/Schema/DateTime.php

@dg dg added the enhancement New feature or request label Jan 21, 2021
@deba12
Copy link

deba12 commented May 25, 2021

I like the idea for both Date and DateTime.
At the moment we are using assert to validate Date/DateTime, then we still have to use Date/DateTime to make some comparisons
and so on. This example from subreg-api-php is cool, it returns Date/DateTime object.
@dg could you please implement it?

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

No branches or pull requests

3 participants