Skip to content

Commit

Permalink
feat: 🎸 [Task]onEndTimeRange function refactored
Browse files Browse the repository at this point in the history
✅ Closes: #198
  • Loading branch information
CrisGrud committed Feb 29, 2024
1 parent 650daf4 commit 9f01d48
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/tasks/utils/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,12 @@ export const onEndTimeRange = (
const nexDayMillis = startDate.startOf("day").toMillis() + 24 * hrs;

let gap = 0;
if (diffTZ !== 0) {
gap = hrs * diffTZ;
if (diffTZInDay !== 0 && startTaskMillis < nexDayMillis) {
gap = 0;
if (resolution.unit === "day" || resolution.unit === "week") {
if (diffTZ !== 0) {
gap = hrs * diffTZ;
if (diffTZInDay !== 0 && startTaskMillis < nexDayMillis) {
gap = 0;
}
}
}
const start = interval.start!.plus({ [resolution.unit]: timeOffset }).toMillis() - gap;
Expand Down

0 comments on commit 9f01d48

Please sign in to comment.