schema
schema copied to clipboard
Add DateTime and DateTimeRange expectations
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.
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
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?