Prevent total time from displaying as 0:00 in box score
This commit is contained in:
@@ -108,6 +108,14 @@ if ( ! isset( $subs ) ) $subs = array();
|
|||||||
$format = sp_array_value( $formats, $key, 'number' );
|
$format = sp_array_value( $formats, $key, 'number' );
|
||||||
$placeholder = sp_get_format_placeholder( $format );
|
$placeholder = sp_get_format_placeholder( $format );
|
||||||
|
|
||||||
|
if ( ! array_key_exists( $key, $totals ) ):
|
||||||
|
$totals[ $key ] = $placeholder;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
if ( 'time' === $format ):
|
||||||
|
$totals[ $key ] = ' ';
|
||||||
|
endif;
|
||||||
|
|
||||||
$value = '-';
|
$value = '-';
|
||||||
if ( $key == 'position' ):
|
if ( $key == 'position' ):
|
||||||
$positions = array();
|
$positions = array();
|
||||||
@@ -134,10 +142,6 @@ if ( ! isset( $subs ) ) $subs = array();
|
|||||||
$value = $placeholder;
|
$value = $placeholder;
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
if ( ! array_key_exists( $key, $totals ) ):
|
|
||||||
$totals[ $key ] = $placeholder;
|
|
||||||
endif;
|
|
||||||
|
|
||||||
if ( 'number' === $format ):
|
if ( 'number' === $format ):
|
||||||
$value = floatval( $value );
|
$value = floatval( $value );
|
||||||
$totals[ $key ] += $value;
|
$totals[ $key ] += $value;
|
||||||
|
|||||||
Reference in New Issue
Block a user