add linter

This commit is contained in:
Romulus21
2024-02-18 23:30:50 +01:00
parent b53d378ec1
commit ebfc56eba3
34 changed files with 568 additions and 262 deletions

View File

@@ -1,7 +1,7 @@
import React, {useEffect, useState} from "react"
import useTracker from "../../hooks/TraskerHook"
import {Link} from "react-router-dom";
import {StopSVG} from "../SVG";
import {Link} from "react-router-dom"
import {StopSVG} from "../SVG"
const Tracker = () => {
@@ -14,14 +14,14 @@ const Tracker = () => {
useEffect(() => {
setTimeout(() => setTimer(formatTimer(currentTimeTracker?.start_at)), 1000)
}, [timer]);
}, [timer])
const formatTimer = (startAt: string|null|undefined) => {
if (!startAt) {
return '--:--'
}
let timer = Math.floor(((new Date()).getTime() - (new Date(startAt)).getTime()) / 1000)
return timer.durationify()
const timer = Math.floor(((new Date()).getTime() - (new Date(startAt)).getTime()) / 1000)
return Number(timer).durationify()
// let hours = Math.floor(timer / 3600)
// let minutes = Math.floor((timer - hours * 3600) / 60)
// let secondes = timer - hours * 3600 - minutes * 60