Navigating dates (specially with time) is always such a hassle. It would be great if there would be a “reset”-button on the input widget for DateTime.
I would like it to reset the date to whatever was specified in <default></default>. Specifically I would love if could be reset to now (if that was what I specified).
Good feature request, you are not the first one to request this. We have a simular feature request on getting a “now” button to the datepicker. The design and functionality is not set in stone, but as far as i can tell we would add “now” as a button and set the date to the current date if no default is selected.
Would something like this work or does that not overlap with this feature request?
If I understand you correctly I think there is a difference here:
The “Now”-button sets an empty field to the current date
The “Reset”-button takes a field which has a date already (because it would be populated if <default></default> exists), but replaces it with a new date based on the contents of <default> from the content type xml.
The use case I have that led me to suggest this feature is that I have a field in my content type for when the article has been “editorally modified”. This field is set manually, since we don’t want to include changes like fixing typos.
Having a “Now”-button would solve my use case (if it can overwrite the current value), but resetting to <default></default> might be more powerful for other use cases. Specially when using math like described in the DateTime-input documentation.
@tom We have started working on this feature. If we implement the Reset button then this button will revert the changes done since the last modification, which means:
If date input has a <default> value and didn’t have a value previously saved in the content, then Reset will change to the default value (what was discussed earlier in this thread), but
If date input already had another value saved in the property set (which may be different from the default one), then Reset will revert to that. Otherwise it will be confusing for end-user if Reset button changes not to the value user initially saw in the field but to some previously unseen value (from <default>).
So basically, Reset will revert to the last saved value OR default (if it’s set in the schema and no previous value was saved).
After further discussion we got another idea - we call the button “Set default” and we only show it when there’s default value set in the XML schema.
Otherwise (as described above) “Reset” behaviour will be confusing. User can already now reset changes made to the initial value by clicking Escape button while the datepicker dialog is open.