Skip to content

Commit

Permalink
misc bugfix around datetime parsing
Browse files Browse the repository at this point in the history
If there was no datetime, then some of the parsing would fail
  • Loading branch information
jamiebrynes7 committed Jan 31, 2024
1 parent 17f5d57 commit df32810
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/api/domain/dueDate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export function getDueDateInfo(dueDate: DueDate | undefined): DueDateInfo {
const isToday = date.isSame(new Date(), "day");
const isOverdue = hasTime ? date.isBefore() : date.clone().add(1, "day").isBefore()


return {
hasDate: true,
hasTime: hasTime,
Expand Down
2 changes: 1 addition & 1 deletion src/data/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export class TodoistAdapter {
labels: apiTask.labels,
priority: apiTask.priority,

due: apiTask.due,
due: apiTask.due ?? undefined,
order: apiTask.order
};
}
Expand Down
4 changes: 4 additions & 0 deletions src/ui/TaskRenderer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
$: dateTimeClass = getDateTimeClass(dateInfo);
function getDueDateLabel(info: DueDateInfo): string {
if (info.m === undefined) {
return "";
}
if (info.hasTime) {
return info.m.calendar();
}
Expand Down

0 comments on commit df32810

Please sign in to comment.