@azure/communication-react
Version:
React library for building modern communication user experiences utilizing Azure Communication Services
30 lines • 747 B
JavaScript
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/**
* @internal
*/
export const getMinutes = (time) => {
return Math.floor(getSeconds(time) / 60);
};
/**
* @internal
*/
export const getSeconds = (time) => {
return Math.floor(time / 1000);
};
/**
* @internal
*/
export const getHours = (time) => {
return Math.floor(getMinutes(time) / 60);
};
/**
* @internal
*/
export const getReadableTime = (time) => {
const hours = getHours(time);
const readableMinutes = ('0' + getMinutes(time) % 60).slice(-2);
const readableSeconds = ('0' + getSeconds(time) % 60).slice(-2);
return `${hours > 0 ? hours + ':' : ''}${readableMinutes}:${readableSeconds}`;
};
//# sourceMappingURL=timerUtils.js.map