Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix: Time entries offsets
  • Loading branch information
cxcarvaj committed Feb 11, 2022
commit 77ec46b10935fe38ba9c6508076dccf38b1b591f
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const doClockOut = async (context) => {
}
timeEntryAsJson.end_date = timeEntry.getTimeToClockOutMidnight();
await container.item(timeEntryAsJson.id, timeEntryAsJson.tenant_id).replace(timeEntryAsJson);
totalClockOutsExecuted++;
}
})
);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"dependencies": {
"@azure/cosmos": "3.5.2",
"@azure/msal-node": "^1.0.0-alpha.5",
"@slack/web-api": "^6.0.0",
"axios": "^0.20.0",
"dotenv": "^8.2.0",
"dotenv": "^16.0.0",
"moment": "^2.27.0",
"@slack/web-api": "^6.0.0",
"msal": "^1.4.0"
},
"author": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ class TimeEntry {
}

getMidnightInTimeEntryZone(){
return moment(this.timeEntry.start_date).utc()
.subtract(this.timeEntry.timezone_offset, 'minutes').endOf('day');
return moment(this.timeEntry.start_date).utcOffset(this.timeEntry.timezone_offset * -1).endOf('day');
}

getTimeToClockOutMidnight(){
return moment().utc().endOf('day').toISOString();
return moment(this.timeEntry.start_date).utcOffset(this.timeEntry.timezone_offset * -1).endOf('day').toISOString();
}

getCurrentTimeInTimeEntryZone(){
Expand Down