Feat/studio clock (#60)

This commit is contained in:
Carlos Valente
2021-12-13 21:29:56 +01:00
committed by GitHub
parent 627cce7ba6
commit 80c2e9a8ba
26 changed files with 1099 additions and 135 deletions
+2 -4
View File
@@ -40,11 +40,11 @@ export const stringFromMillis = (
* another go at simpler string formatting (counters)
* @description Converts seconds to string representing time
* @param {number} seconds - time in seconds
* @param {boolean} hideZero - wether to show hours in case its 00
* @param {boolean} [hideZero] - whether to show hours in case its 00
* @returns {string} String representing absolute time 00:12:02
*/
export function formatDisplay(seconds, hideZero) {
export function formatDisplay(seconds, hideZero=false) {
// add an extra 0 if necessary
const format = (val) => `0${Math.floor(val)}`.slice(-2);
@@ -59,7 +59,6 @@ export function formatDisplay(seconds, hideZero) {
/**
* @description Converts milliseconds to seconds
* @param {number} millis - time in seconds
* @param {boolean} hideZero - wether to show hours in case its 00
* @returns {number} Amount in seconds
*/
@@ -71,7 +70,6 @@ export const millisToSeconds = (millis) => {
/**
* @description Converts milliseconds to seconds
* @param {number} millis - time in seconds
* @param {boolean} hideZero - wether to show hours in case its 00
* @returns {number} Amount in seconds
*/