diff --git a/task_yell/src/app/home/page.tsx b/task_yell/src/app/home/page.tsx index 16a701c..378f3d6 100644 --- a/task_yell/src/app/home/page.tsx +++ b/task_yell/src/app/home/page.tsx @@ -75,14 +75,11 @@ type Todo = { type Event = { id: number; title: string; + start: Date; + end: Date; description: string; - date: Date; - startTime: string; - endTime: string; category: Category; priority: Priority; - start: Date; - end: Date; location: string; invitees: string; isTask: boolean; @@ -104,14 +101,16 @@ function EventCreator({ onSave, onCancel, initialTitle = "", + targetDate, }: { onSave: (event: Event) => void; onCancel: () => void; initialTitle?: string; + targetDate: Date; }) { const [title, setTitle] = useState(initialTitle); const [description, setDescription] = useState(""); - const [date] = useState(new Date()); + const [selectedDate] = useState(targetDate); const [startTime] = useState("10:00"); const [endTime] = useState("11:00"); const [location, setLocation] = useState(""); @@ -122,18 +121,15 @@ function EventCreator({ const [isLocked, setIsLocked] = useState(false); const handleSave = () => { - if (date) { + if (targetDate) { const newEvent: Event = { id: Date.now(), title, + start: new Date(`${format(selectedDate, "yyyy-MM-dd")}T${startTime}`), + end: new Date(`${format(selectedDate, "yyyy-MM-dd")}T${endTime}`), description, - date, - startTime, - endTime, category, priority, - start: new Date(`${format(date, "yyyy-MM-dd")}T${startTime}`), - end: new Date(`${format(date, "yyyy-MM-dd")}T${endTime}`), location, invitees, isTask, @@ -148,7 +144,9 @@ function EventCreator({

- {format(date || new Date(), "yyyy年MM月dd日 (E)", { locale: ja })} + {format(targetDate || new Date(), "yyyy年MM月dd日 (E)", { + locale: ja, + })}

{Array.from({ length: 24 }).map((_, hour) => ( @@ -179,11 +177,11 @@ function EventCreator({
{isTask ? ( - + ) : (
- - + +
)} @@ -810,6 +808,7 @@ export default function Home() { setIsEventModalOpen(false); }} initialTitle={draggedStickyNote ? draggedStickyNote.title : ""} + targetDate={selectedDate} />