Skip to content

Commit

Permalink
fix: do not allow tasks to go beyond day border
Browse files Browse the repository at this point in the history
resolves: #254
  • Loading branch information
ivan-lednev committed Oct 28, 2023
1 parent 59fb22c commit f0c9a82
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion esbuild.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const context = await esbuild.context({
plugins: [
sassPlugin(),
esbuildSvelte({
compilerOptions: { css: true, dev: true },
compilerOptions: { css: true, dev: !prod },
preprocess: sveltePreprocess()
})
]
Expand Down
2 changes: 0 additions & 2 deletions src/parser/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,12 @@ export function getListItemsUnderHeading(
});
}

// todo: this belongs to metadata-utils
export function getHeadingByText(metadata: CachedMetadata, text: string) {
const { headings = [] } = metadata;

return headings?.find((h) => h.heading === text);
}

// todo: we don't need this, delete it
export function createTask({
line,
completeContent,
Expand Down
2 changes: 1 addition & 1 deletion src/service/dataview-facade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function sTaskToTask(sTask: STask, day: Moment): Task {
},
});

const durationMinutes = endTime
const durationMinutes = endTime?.isAfter(startTime)
? getDiffInMinutes(endTime, startTime)
: undefined;

Expand Down

0 comments on commit f0c9a82

Please sign in to comment.