mirror of
https://github.com/10h30/wp-strava.git
synced 2026-07-13 19:56:41 +09:00
Added check for empty activity time
This commit is contained in:
@@ -36,6 +36,10 @@ abstract class WPStrava_SOM {
|
||||
* @see https://stackoverflow.com/a/20870843/2146022
|
||||
*/
|
||||
public function time( $seconds ) {
|
||||
if ( empty( $seconds ) ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$zero = new DateTime( '@0' );
|
||||
$offset = new DateTime( "@{$seconds}" );
|
||||
$diff = $zero->diff( $offset );
|
||||
|
||||
Reference in New Issue
Block a user