Closed davidwolfpaw closed 7 years ago
My Fitbit data is pulled in minutes, not seconds. I had to rewrite the following function in my replacement importer from
function format_duration( $num ) { if ( $num < 3600 ) { return sprintf( __( '%s minutes', 'keyring' ), round( $num / 60 ) ); } else { $hours = floor( $num / 60 / 60 ); $num = $num - ( $hours * 60 * 60 ); return sprintf( __( '%1$s hours, %2$s minutes', 'keyring' ), $hours, round( $num / 60 ) ); } }
to
function format_duration( $num ) { if ( $num < 60 ) { return sprintf( __( '%s minutes', 'keyring' ), $num ); } else { $hours = floor( $num / 60 ); $min = $num - ( $hours * 60 ); return sprintf( __( '%1$s hours, %2$s minutes', 'keyring' ), $hours, $min ); } }
My Fitbit data is pulled in minutes, not seconds. I had to rewrite the following function in my replacement importer from
to