Skip to content

Commit

Permalink
fix: some bugs in task builder
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvincent committed Sep 28, 2023
1 parent 5fee655 commit 2a65b91
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/desktop-v2/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function Home() {
</div>
) : taskFetchState.status === "success" ? (
<div
className="flex flex-col items-center w-full max-h-full gap-2 overflow-clip max-w-xl"
className="flex flex-col items-center w-full max-h-full gap-2 max-w-xl"
ref={taskListRef}
>
<hr className="w-64" />
Expand Down Expand Up @@ -148,7 +148,7 @@ function Home() {
</Accordion.AccordionTrigger>
<Accordion.AccordionContent className="py-2">
<div
className="flex flex-col items-center w-full max-h-full gap-2 overflow-clip"
className="flex flex-col items-center w-full max-h-full gap-2 overflow-scroll"
ref={taskListRef}
>
{doneTasks.map((task, doneIndex) => (
Expand Down
9 changes: 9 additions & 0 deletions apps/desktop-v2/components/task-builder-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,14 @@ export const TaskBuilderDialog = (props: {
}
// extract the start at time if any
const extractedStartAt = extractStartAt(newTitle);
// if the start at time is present, then set the start time to the start at time
let startTime: Date | undefined = props.editingTask.startTime;
if (extractedStartAt !== null) {
// start time input is present -> init start time
// if initially the start time was not set
if (startTime === undefined) {
startTime = new Date();
}
// set only the interdate part
startTime?.setHours(extractedStartAt.value.getHours());
startTime?.setMinutes(extractedStartAt.value.getMinutes());
Expand All @@ -105,6 +111,9 @@ export const TaskBuilderDialog = (props: {
newTitle.slice(
extractedStartAt.match.index + extractedStartAt.match[0].length
);
} else {
// start time input is not present -> remove the start time
startTime = undefined;
}

// extract the date if any
Expand Down

1 comment on commit 2a65b91

@vercel
Copy link

@vercel vercel bot commented on 2a65b91 Sep 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.