diff --git a/web/src/routes/Events.jsx b/web/src/routes/Events.jsx index 4b305e97f..16da884ec 100644 --- a/web/src/routes/Events.jsx +++ b/web/src/routes/Events.jsx @@ -37,6 +37,21 @@ const monthsAgo = (num) => { return new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() / 1000; }; +const clipLength = (num) => { + let totalSeconds = num; + let hours = Math.floor(totalSeconds / 3600); + totalSeconds %= 3600; + let minutes = Math.floor(totalSeconds / 60); + let seconds = (totalSeconds % 60).toFixed(0); + let length=`${hours} Hours ${minutes} Minutes ${seconds} Seconds` + if (hours == 0 && minutes == 0) { + length=`${seconds} Seconds` + } else { + length=`${minutes} Minutes ${seconds} Seconds` + } + return length; +} + export default function Events({ path, ...props }) { const apiHost = useApiHost(); const [searchParams, setSearchParams] = useState({ @@ -455,12 +470,11 @@ export default function Events({ path, ...props }) {