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 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 hours = Math.floor(seconds / 3600);
107
- const minutes = Math.round((seconds - hours * 3600) / 60);
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hevy-shared",
3
- "version": "1.0.718",
3
+ "version": "1.0.719",
4
4
  "description": "",
5
5
  "main": "built/index.js",
6
6
  "types": "built/index.d.ts",