Skip to content

Commit 95eca6c

Browse files
Clock Log Local Time
- Now instead the time logged is based on the user's local time
1 parent ba9f42c commit 95eca6c

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,12 +327,17 @@ async function deleteSubtopic(subtopicID){
327327

328328
ipcMain.handle('log-time-handler', async (req, data) => {
329329
if (!data) return;
330-
const sqlStatement = `INSERT INTO clock (topicID, subtopicID, project, time, date) VALUES (?, ?, ?, ?, CURRENT_TIMESTAMP)`;
330+
331+
const sqlStatement = `
332+
INSERT INTO clock (topicID, subtopicID, project, time, date)
333+
VALUES (?, ?, ?, ?, datetime("now", "localtime"))
334+
`;
335+
331336
const params = [data.topicID, data.subtopicID, data.project, data.time];
332337
const result = databaseHandler('run', sqlStatement, params);
333338

334339
const addProjectResult = await addProject(data.topicID, data.subtopicID, data.project);
335-
if (addProjectResult === 'duplicate'){
340+
if (addProjectResult === 'duplicate') {
336341
updateProjectPreviousClock(data.project);
337342
}
338343

0 commit comments

Comments
 (0)