add linter
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user