mirror of
https://github.com/10h30/wp-strava.git
synced 2026-07-18 06:03:49 +09:00
Added System of Measure (English) unit tests;
Fixed a bug in pace formatting
This commit is contained in:
+12
-2
@@ -29,10 +29,20 @@ abstract class WPStrava_SOM {
|
||||
abstract public function pace( $mps );
|
||||
abstract public function get_pace_label();
|
||||
|
||||
/**
|
||||
* Create a time string of hours:minutes:seconds from just seconds.
|
||||
*
|
||||
* @return string Time formatted as 'H:i:s'.
|
||||
*/
|
||||
public function time( $seconds ) {
|
||||
return date( 'H:i:s', mktime( 0, 0, $seconds ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Label for hours.
|
||||
*
|
||||
* @return string 'hours'
|
||||
*/
|
||||
public function get_time_label() {
|
||||
return __( 'hours', 'wp-strava' );
|
||||
}
|
||||
@@ -49,8 +59,8 @@ abstract class WPStrava_SOM {
|
||||
/**
|
||||
* Change meters per second to Minutes Per 100 Meters. Same for English/metric.
|
||||
*
|
||||
* @param float $mps Meters per second.
|
||||
* @return float Minutes Per 100 Meters.
|
||||
* @param float|string $mps Meters per second.
|
||||
* @return string Minutes Per 100 Meters.
|
||||
*/
|
||||
public function swimpace( $mps ) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user