I would like to display the date submitted on the View Issues page. I have followed the instructions given on this board for custom fields viewing, etc. Therefore, I have altered the custom_function_default_get_columns_to_view () in the custom function api to include the date submitted instead of the category which we do not use.
The output for each fault is a strange value. I have searched the database for these values to no avail.
ex.
Date Submitted:
1151919694
1151917969
1151920052
Any ideas where this value is coming from and how I can properly call the date_submitted value??
Thanks in advance, Michael
Trouble adding date_submitted column to View All page
Moderators: Developer, Contributor
That value is a timestamp: it needs to be converted via the date function call.
Assuming the timestamp is stored in $date_var and assuming you want to store the value you will eventually display in $date_formatted_var, do something like:
I hope this makes sense and that it helps!
Assuming the timestamp is stored in $date_var and assuming you want to store the value you will eventually display in $date_formatted_var, do something like:
Code: Select all
$date_formatted_var = date( config_get( 'normal_date_format' ), $date_var );
Trouble adding date_submitted column to View All page
This post is so old that I doubt you're still waiting for a reply but I figured for people like myself that couldn't find an answer, I'd post one:
In your custom_functions_inc.php file add this function:
This worked for version Mantis 1.0.3
In your custom_functions_inc.php file add this function:
Code: Select all
# --------------------
# $p_columns_target: see COLUMNS_TARGET_* in constant_inc.php
function print_column_date_submitted( $p_row, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
global $t_filter;
$t_date_submitted = date( config_get( 'short_date_format' ), $p_row['date_submitted'] );
echo '<td class="center">';
if ( $p_row['date_submitted'] > strtotime( '-'.$t_filter['highlight_changed'].' hours' ) ) {
printf( '<span class="bold">%s</span>', $t_date_submitted );
} else {
echo $t_date_submitted;
}
echo '</td>';
}
That is fixed in 1.1.0a1.
http://www.mantisbt.org/bugs/view.php?id=7348
The change in the code base can be found at:
http://mantisbt.cvs.sourceforge.net/man ... 14&r2=1.15
http://www.mantisbt.org/bugs/view.php?id=7348
The change in the code base can be found at:
http://mantisbt.cvs.sourceforge.net/man ... 14&r2=1.15
Migrate your MantisBT to the MantisHub Cloud