hevy-shared 1.0.718 → 1.0.719
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/built/utils.d.ts +1 -0
- package/built/utils.js +4 -2
- package/package.json +1 -1
package/built/utils.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ export declare const secondsToWordFormat: (seconds: number) => string;
|
|
|
33
33
|
/**
|
|
34
34
|
* 14min
|
|
35
35
|
* 2h 4min
|
|
36
|
+
* 2h 0min
|
|
36
37
|
*/
|
|
37
38
|
export declare const secondsToWordFormatMinutes: (seconds: number) => string;
|
|
38
39
|
export declare const isValidEmail: (email: string) => boolean;
|
package/built/utils.js
CHANGED
|
@@ -101,10 +101,12 @@ exports.secondsToWordFormat = secondsToWordFormat;
|
|
|
101
101
|
/**
|
|
102
102
|
* 14min
|
|
103
103
|
* 2h 4min
|
|
104
|
+
* 2h 0min
|
|
104
105
|
*/
|
|
105
106
|
const secondsToWordFormatMinutes = (seconds) => {
|
|
106
|
-
const
|
|
107
|
-
const minutes =
|
|
107
|
+
const totalMinutes = Math.round(seconds / 60);
|
|
108
|
+
const minutes = totalMinutes % 60;
|
|
109
|
+
const hours = Math.floor(totalMinutes / 60);
|
|
108
110
|
if (hours) {
|
|
109
111
|
return `${hours}h ${minutes}min`;
|
|
110
112
|
}
|