Adjust date picker to display placeholder text when no date is selected

Fix an issue in the task creation form where the date picker component did not display placeholder text correctly when no date was selected.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: cc2d271b-82f0-4d6a-9302-a0b067ffb429
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/cc2d271b-82f0-4d6a-9302-a0b067ffb429/yX1PBud
This commit is contained in:
michaelschal committed 2025-08-19 09:41:20 +00:00
1 parent a951c0be4c
commit b40924aec5
2 files changed
+3 -9

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 KiB

+3 -9
View File
@@ -18,7 +18,7 @@ import { z } from "zod";
import { CalendarIcon, Clock, AlertTriangle, Info } from "lucide-react";
import { format } from "date-fns";
import { fr } from "date-fns/locale";
import { cn } from "@/lib/utils";
type TaskWithRelations = Task & {
assignedUser?: { id: string; username: string; firstName?: string; lastName?: string; };
@@ -361,10 +361,7 @@ export default function NewTaskForm({ task, onClose }: NewTaskFormProps) {
<FormControl>
<Button
variant={"outline"}
className={cn(
"w-full pl-3 text-left font-normal",
!field.value && "text-muted-foreground"
)}
className={field.value ? "w-full pl-3 text-left font-normal" : "w-full pl-3 text-left font-normal text-muted-foreground"}
>
{field.value ? (
format(field.value, "PPP", { locale: fr })
@@ -407,10 +404,7 @@ export default function NewTaskForm({ task, onClose }: NewTaskFormProps) {
<FormControl>
<Button
variant={"outline"}
className={cn(
"w-full pl-3 text-left font-normal",
!field.value && "text-muted-foreground"
)}
className={field.value ? "w-full pl-3 text-left font-normal" : "w-full pl-3 text-left font-normal text-muted-foreground"}
>
{field.value ? (
format(field.value, "PPP", { locale: fr })