Skip to content

Commit

Permalink
Fix #12363: Billing report end date is inaccurate
Browse files Browse the repository at this point in the history
The strototime() function was being called incorrectly, leading to the
last day of a billing report range not being included in the results.

There was also an off-by-one-second mistake with calculating the
timestamp denoting the end of any given day in the billing report range.

Thanks to vr5 for the initial patch.
  • Loading branch information
davidhicks committed Nov 19, 2010
1 parent b6e66fb commit 0bf8b4f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/bugnote_api.php
Expand Up @@ -589,7 +589,7 @@ function bugnote_format_id( $p_bugnote_id ) {
*/
function bugnote_stats_get_events_array( $p_bug_id, $p_from, $p_to ) {
$c_bug_id = db_prepare_int( $p_bug_id );
$c_to = strtotime( $p_to, SECONDS_PER_DAY - 1 ); // @23:59:59
$c_to = strtotime( $p_to ) + SECONDS_PER_DAY - 1;
$c_from = strtotime( $p_from );

$t_user_table = db_get_table( 'mantis_user_table' );
Expand Down Expand Up @@ -637,7 +637,7 @@ function bugnote_stats_get_events_array( $p_bug_id, $p_from, $p_to ) {
function bugnote_stats_get_project_array( $p_project_id, $p_from, $p_to, $p_cost ) {
$c_project_id = db_prepare_int( $p_project_id );

$c_to = strtotime( $p_to ) + SECONDS_PER_DAY;
$c_to = strtotime( $p_to ) + SECONDS_PER_DAY - 1;
$c_from = strtotime( $p_from );

if ( $c_to === false || $c_from === false ) {
Expand Down

0 comments on commit 0bf8b4f

Please sign in to comment.