Feature #25035
open
Option to set current date as a default value of date format custom field
Added by Go MAEDA about 9 years ago.
Updated 4 days ago.
Files
I wrote a patch to realize this feature.
Implementation for setting the default value to current date may not be the best way.
Feedback is welcome.
- Target version set to Candidate for next minor release
Thank you for sharing the patch. The patch looks fine.
- Target version changed from Candidate for next minor release to 4.1.0
What do you all think about this patch? Feedbacks welcome.
- Target version changed from 4.1.0 to Candidate for next minor release
Mizuki ISHIKAWA wrote:
I wrote a patch to realize this feature.
Implementation for setting the default value to current date may not be the best way.
Feedback is welcome.
Thanks for your patch. It's a usefull feature but this patch has the side effect that it makes the string "current_date" a valid value for date custom fields. I think we need a different approach.
Jean-Philippe Lang wrote in #note-5:
it makes the string "current_date" a valid value for date custom fields.
Is it a serious problem ? Under what conditon , will it happen ?
I am considering using this patch
I wrote a new patch that adds a "Today" option using a different implementation approach.
As noted in #note-5, storing a literal string such as current_date in the default_value column would be problematic. To avoid that, this patch stores the selection mode separately in format_store as default_value_mode, with fixed_date and current_date as its possible values.
With this approach, administrators can choose either a fixed date or Today as the default value for date custom fields without storing a special token in the default_value column.

Also available in: Atom
PDF