Comparing version 0.11.12 to 0.12.12
@@ -203,6 +203,15 @@ "use strict"; | ||
} | ||
let monthDurationCounter = 0; | ||
let periodString = ""; | ||
let data = ""; | ||
let notifyMsg = ""; | ||
Object.entries(resp.data).forEach((month) => { | ||
Object.entries(resp.data).forEach((month, idx, list) => { | ||
const [monthName, monthData] = month; | ||
if (idx == 0) { | ||
periodString += `from ${monthName}`; | ||
} | ||
else if (idx == list.length - 1) { | ||
periodString += ` to ${monthName}`; | ||
} | ||
monthDurationCounter += monthData.duration; | ||
const monthTitle = `\n${monthName}: ${utils_1.default.secToTimeStr(monthData.duration * 60 * 60)} | ${monthData.hoursPerDay.toFixed(2)} hours per day`; | ||
@@ -217,2 +226,5 @@ data += monthTitle; | ||
}); | ||
// adding total hours | ||
// data += `\n\nTotal Duration: ${tools.secToTimeStr(monthDurationCounter * 60 * 60)} (${periodString})`; | ||
data += `\n\nTotal Duration: ${utils_1.default.secToTimeStr(monthDurationCounter * 60 * 60)}`; | ||
socket.write(JSON.stringify({ err: false, data })); | ||
@@ -219,0 +231,0 @@ utils_1.default.notify("activities duration", notifyMsg, "green"); |
{ | ||
"name": "clockify", | ||
"version": "0.11.12", | ||
"version": "0.12.12", | ||
"description": "A time tracker to make sure that you really spent the time you think you spent working, studying, etc.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
50452
1211