-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
Today default for date widget #336
Comments
Or does it make more sense the other way around, having the defaults set the format (e.g. |
jimafisk
added a commit
that referenced
this issue
Aug 16, 2024
jimafisk
added a commit
that referenced
this issue
Aug 16, 2024
This should be available in v0.6.54 You can now use the following options in your date schema:
An example {
"my_date": {
"type": "date",
"options": ["today + 3"]
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In
_defaults.json
if you put string that matches our date patterns, the CMS will automatically give you a date widget. For example:However, as the months pass this day becomes quite stale and content editors have to click to bring the widget to the current day (something that is typically wanted when creating content). It would be nice if the date widget automatically picked up on a value of
"today"
and converted this to the current date. For example:One challenge here is that we also try to retain the date format used in your defaults when displaying (
1-1-24
would display different than1/1/24
), so we'd have to infer the format used here. We should probably extend thedate
field widget to allow setting this viaoptions
in_schema.json
:We may want to eventually add other modifiers like
yesterday
,+ N days
,- N days
, etc.The text was updated successfully, but these errors were encountered: