remove unused functions

This commit is contained in:
proddy
2023-01-19 09:10:03 +01:00
parent a3c302176b
commit 1407a61f7a

View File

@@ -16,23 +16,23 @@ export const formatLocalDateTime = (date: Date) => {
return new Date(date.getTime() - date.getTimezoneOffset() * 60000).toISOString().slice(0, -1).substr(0, 19);
};
export const pluralize = (count: number, noun: string) =>
`${Intl.NumberFormat().format(count)} ${noun}${count !== 1 ? 's' : ''}`;
// export const pluralize = (count: number, noun: string) =>
// `${Intl.NumberFormat().format(count)} ${noun}${count !== 1 ? 's' : ''}`;
export const formatDurationSec = (duration_sec: number) => {
if (duration_sec === 0) {
return ' ';
}
const roundTowardsZero = duration_sec > 0 ? Math.floor : Math.ceil;
return (
', ' +
roundTowardsZero(duration_sec / 86400) +
'd ' +
(roundTowardsZero(duration_sec / 3600) % 24) +
'h ' +
(roundTowardsZero(duration_sec / 60) % 60) +
'm ' +
(roundTowardsZero(duration_sec) % 60) +
's'
);
};
// export const formatDurationSec = (duration_sec: number) => {
// if (duration_sec === 0) {
// return ' ';
// }
// const roundTowardsZero = duration_sec > 0 ? Math.floor : Math.ceil;
// return (
// ', ' +
// roundTowardsZero(duration_sec / 86400) +
// 'd ' +
// (roundTowardsZero(duration_sec / 3600) % 24) +
// 'h ' +
// (roundTowardsZero(duration_sec / 60) % 60) +
// 'm ' +
// (roundTowardsZero(duration_sec) % 60) +
// 's'
// );
// };