Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
yuto-trd committed Oct 27, 2024
1 parent 25ff678 commit 3593e05
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
14 changes: 8 additions & 6 deletions task_yell/src/app/home/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ function EventCreator({
</div>

{isTask ? (
<DateTimeInput className="w-full"
<DateTimeInput
className="w-full"
date={startTime}
onChanged={(date) => setStartTime(date)}
/>
Expand All @@ -252,7 +253,7 @@ function EventCreator({
<DateTimeInput
className="w-full"
date={endTime}
onChanged={(date) => setEndTime(date)}
onChanged={(date) => setEndTime(date)}
/>
</div>
)}
Expand Down Expand Up @@ -500,10 +501,11 @@ export default function Home() {
return (
<motion.div
key={day.toISOString()}
className={`p-1 border rounded-md cursor-pointer transition-all duration-300 overflow-hidden ${isSelected ? "border-blue-300 dark:border-blue-600" : ""} ${!isCurrentMonth
? "text-gray-400 dark:text-gray-600 bg-gray-100 dark:bg-gray-700"
: ""
} ${getTaskIndicatorStyle(todoCount, eventCount)} hover:bg-gray-100 dark:hover:bg-gray-700`}
className={`p-1 border rounded-md cursor-pointer transition-all duration-300 overflow-hidden ${isSelected ? "border-blue-300 dark:border-blue-600" : ""} ${
!isCurrentMonth
? "text-gray-400 dark:text-gray-600 bg-gray-100 dark:bg-gray-700"
: ""
} ${getTaskIndicatorStyle(todoCount, eventCount)} hover:bg-gray-100 dark:hover:bg-gray-700`}
onClick={() => handleDateSelect(day)}
whileHover={{ scale: 1.05 }}
whileTap={{ scale: 0.95 }}
Expand Down
5 changes: 2 additions & 3 deletions task_yell/src/components/date-time-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { useMemo } from "react";
export function DateTimeInput({
className,
date,
onChanged
onChanged,
}: {
className?: string;
date: Date;
Expand All @@ -35,10 +35,9 @@ export function DateTimeInput({
return `${hours}:${minutes}`;
});
const time = useMemo(() => {
return `${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`;
return `${date.getHours().toString().padStart(2, "0")}:${date.getMinutes().toString().padStart(2, "0")}`;
}, [date]);


return (
<div className={`flex flex-row ${className}`}>
<div className="flex flex-row items-center gap-2 w-full">
Expand Down

0 comments on commit 3593e05

Please sign in to comment.