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

Allow relative min and max values using strtotime syntax in AgaviDateTimeValidator #1018

Closed
dzuelke opened this Issue Feb 2, 2009 · 2 comments

Comments

Projects
None yet
2 participants
@dzuelke
Contributor

dzuelke commented Feb 2, 2009

```
+1 week
```

(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.

@ddelbondio

This comment has been minimized.

Show comment
Hide comment
@ddelbondio

ddelbondio Feb 2, 2009

Member

(In a096779a805ca15a442e4fb92e0ebb2b4f833a88) fixes #1018: Allow relative min and max values using strtotime syntax in [AgaviDateTimeValidator](http://github.com/agavi/agavi/wiki/AgaviDateTimeValidator)

Member

ddelbondio commented Feb 2, 2009

(In a096779a805ca15a442e4fb92e0ebb2b4f833a88) fixes #1018: Allow relative min and max values using strtotime syntax in [AgaviDateTimeValidator](http://github.com/agavi/agavi/wiki/AgaviDateTimeValidator)

@ddelbondio

This comment has been minimized.

Show comment
Hide comment
@ddelbondio

ddelbondio Feb 2, 2009

Member

Issue closed

Member

ddelbondio commented Feb 2, 2009

Issue closed

@ghost ghost assigned ddelbondio Jan 16, 2014

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment