Future Date
Moderators: Developer, Contributor
Future Date
I would like to have a custom field that is displayed when a user enters a bug for the first time called "Target Closure Date". I would like it to default to today+x days. I know how to add a custom field but what is the easiest way to default the field to x number of days in advance of today?
I would like to know this too
Hi how did you solve it?
/A
/A
Solution
Like this....
In bug_report_page.php instead of blindly calling print_custom_field_input you put the following code:
If ($t_def['name'] == your_custom_field_name) {
print_date_selection_set("custom_field_" . $t_def['id'], config_get('short_date_format'), mktime(0,0,0,date("m"),date("d")+14,date("Y")), false, true) ;
} else{
// standard call to print_date_selection_set
print_custom_field_input( $t_def, $f_master_bug_id );
}
If you have more than 1 field to customize then I suggest you use a switch/case control structure.[/code]
In bug_report_page.php instead of blindly calling print_custom_field_input you put the following code:
If ($t_def['name'] == your_custom_field_name) {
print_date_selection_set("custom_field_" . $t_def['id'], config_get('short_date_format'), mktime(0,0,0,date("m"),date("d")+14,date("Y")), false, true) ;
} else{
// standard call to print_date_selection_set
print_custom_field_input( $t_def, $f_master_bug_id );
}
If you have more than 1 field to customize then I suggest you use a switch/case control structure.[/code]