I'm having problems trying to display a custom field of type 'date' in the correct format.
The field is retrieved in epoch (as is stored in 'mantis_custom_field_string_table').
For example, if I set the field with '2017'; 'May'; '15', after submit the field displays '1494806400'.
How can I configure it to display something like 'Y-m-d'?
Thanks!
Date custom field display format
Moderators: Developer, Contributor
Date custom field display format
Mantis: 2.4.1
PHP: 5.6.25
SQL: MySQL 5.7.14
PHP: 5.6.25
SQL: MySQL 5.7.14
Re: Date custom field display format
Finally I've managed to overcome this problem by modifying the function 'print_custom_field_value' in 'custom_field_api.php'
I don't know if this is a bug or there's another problem with my setup that I'm not aware of.
Code: Select all
if ($p_def['type'] == 8) {
echo string_display_line_links( date( config_get('short_date_format'), $t_custom_field_value) );
} else {
echo string_display_line_links( $t_custom_field_value );
}
Mantis: 2.4.1
PHP: 5.6.25
SQL: MySQL 5.7.14
PHP: 5.6.25
SQL: MySQL 5.7.14
Re: Date custom field display format
This is a known issue in 2.4.1, see http://www.mantisbt.org/bugs/view.php?id=22926
I recommend to use 2.4.0 until this is fixed in 2.4.2.
I recommend to use 2.4.0 until this is fixed in 2.4.2.