Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow relative min and max values using strtotime syntax in AgaviDateTimeValidator #1018
(same for `max`)
To achieve that, we change the current parsing implementation for `min`/`max` to always use `strtotime()` unless the given string contains a dot (for milliseconds).
That way, it’s also possible to specify timezones directly in the string, e.g. “last monday this month 08:00UTC” (although we could allow timezones themselves by extending the format string internally to allow Z values).
Mind the system timezone when doing this; we need to set PHP’s timezone to the timezone on the current locale, and then change it back afterwards, as `strtotime()` is `date_default_timezone_get()` aware.