Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
Merge pull request #43 from matejcerny/master
Browse files Browse the repository at this point in the history
  • Loading branch information
tobimori committed Apr 30, 2024
2 parents 21232b2 + cf529ca commit 15e2a6d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugin/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function refreshButtons() {
&& entryData.pid == settings.projectId
&& entryData.description == settings.activity) {
setState(context, 0)
setTitle(context, `${formatElapsed(entryData.duration)}\n\n\n${settings.label}`)
setTitle(context, `${formatElapsed(entryData.start)}\n\n\n${settings.label}`)
} else { //if not, make sure it's 'off'
setState(context, 1)
setTitle(context, settings.label)
Expand All @@ -99,9 +99,9 @@ function refreshButtons() {
})
}

function formatElapsed(elapsedFromToggl)
function formatElapsed(startFromToggl)
{
const elapsed = Math.floor(Date.now()/1000) + elapsedFromToggl
const elapsed = Math.floor(Date.now()/1000) - Math.floor(new Date(startFromToggl).getTime()/1000)
return formatSeconds(elapsed)
}

Expand Down

0 comments on commit 15e2a6d

Please sign in to comment.