Skip to content

Commit

Permalink
fix: handle some typescript issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mvgrimes committed Jul 22, 2024
1 parent 42c0559 commit 53cb876
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"postcss-nested": "^6.0.0",
"ts-jest": "^29.1.1",
"tslib": "^2.6.0",
"typescript": "^5.2.0",
"typescript": "^5.5.0",
"zx": "^7.2.2"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

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

6 changes: 4 additions & 2 deletions src/lib/todo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,17 @@ export class Todo {
}

// moment.js should only be used here (needed for the duration)
setNextDueDate(strict: boolean, duration: any) {
setNextDueDate(strict: boolean, duration: Duration<true>) {
let start = DateTime.now();

if (strict) {
const currentDueDate = this.getDueDate();
if (currentDueDate) start = currentDueDate;
if (currentDueDate?.isValid) start = currentDueDate as DateTime<true>;
// TODO: notify about failed due date parsing?
}

if (!duration) return;

const due = start.plus(duration).toISODate();
if (!due) return; // TODO: notify failed addition?
this.setTag('due', due);
Expand Down

0 comments on commit 53cb876

Please sign in to comment.