Project

General

Profile

Actions

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.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Custom fields
Resolution:

Description

It would be very useful if we can set current date to a date format custom field when we create a new issue.

Related forum post: Create a Custom Field that defaults to the Current Date


Files


Related issues

Related to Redmine - Feature #20382: Date Custom Field Defaut ValueNewActions
Actions #1

Updated by Go MAEDA about 9 years ago

Actions #2

Updated by Mizuki ISHIKAWA over 7 years ago

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.

Actions #3

Updated by Go MAEDA over 7 years ago

  • Target version set to Candidate for next minor release

Thank you for sharing the patch. The patch looks fine.

Actions #4

Updated by Go MAEDA over 7 years ago

  • Target version changed from Candidate for next minor release to 4.1.0

What do you all think about this patch? Feedbacks welcome.

Actions #5

Updated by Jean-Philippe Lang almost 7 years ago

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

Actions #6

Updated by sosogh sosogh almost 3 years ago

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

Actions #7

Updated by Go MAEDA 4 days ago

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.

Actions

Also available in: Atom PDF