mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
remove unused functions
This commit is contained in:
@@ -16,23 +16,23 @@ export const formatLocalDateTime = (date: Date) => {
|
|||||||
return new Date(date.getTime() - date.getTimezoneOffset() * 60000).toISOString().slice(0, -1).substr(0, 19);
|
return new Date(date.getTime() - date.getTimezoneOffset() * 60000).toISOString().slice(0, -1).substr(0, 19);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const pluralize = (count: number, noun: string) =>
|
// export const pluralize = (count: number, noun: string) =>
|
||||||
`${Intl.NumberFormat().format(count)} ${noun}${count !== 1 ? 's' : ''}`;
|
// `${Intl.NumberFormat().format(count)} ${noun}${count !== 1 ? 's' : ''}`;
|
||||||
|
|
||||||
export const formatDurationSec = (duration_sec: number) => {
|
// export const formatDurationSec = (duration_sec: number) => {
|
||||||
if (duration_sec === 0) {
|
// if (duration_sec === 0) {
|
||||||
return ' ';
|
// return ' ';
|
||||||
}
|
// }
|
||||||
const roundTowardsZero = duration_sec > 0 ? Math.floor : Math.ceil;
|
// const roundTowardsZero = duration_sec > 0 ? Math.floor : Math.ceil;
|
||||||
return (
|
// return (
|
||||||
', ' +
|
// ', ' +
|
||||||
roundTowardsZero(duration_sec / 86400) +
|
// roundTowardsZero(duration_sec / 86400) +
|
||||||
'd ' +
|
// 'd ' +
|
||||||
(roundTowardsZero(duration_sec / 3600) % 24) +
|
// (roundTowardsZero(duration_sec / 3600) % 24) +
|
||||||
'h ' +
|
// 'h ' +
|
||||||
(roundTowardsZero(duration_sec / 60) % 60) +
|
// (roundTowardsZero(duration_sec / 60) % 60) +
|
||||||
'm ' +
|
// 'm ' +
|
||||||
(roundTowardsZero(duration_sec) % 60) +
|
// (roundTowardsZero(duration_sec) % 60) +
|
||||||
's'
|
// 's'
|
||||||
);
|
// );
|
||||||
};
|
// };
|
||||||
|
|||||||
Reference in New Issue
Block a user