diff --git a/src/components/campaign/activity/ActivityDateTimeField.tsx b/src/components/campaign/activity/ActivityDateTimeField.tsx index d954b166..9a3ab854 100644 --- a/src/components/campaign/activity/ActivityDateTimeField.tsx +++ b/src/components/campaign/activity/ActivityDateTimeField.tsx @@ -18,6 +18,7 @@ import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/Popover import { floorToMinuteStep, formatBahiaCivilDate, + formatBahiaCivilDateLabel, formatBahiaCivilDateTimeLabel, hourOptions, minuteOptionsForStep, @@ -37,6 +38,9 @@ import { cn } from '@/lib/utils' * C103 — on narrow viewports the picker opens as a nested bottom sheet * (calendar + hour/minute fully on screen, "Pronto" applies and closes), * keeping the desktop popover untouched. + * + * C104 — `timeVisible={false}` is the all-day mode: the trigger formats only + * the date and the picker renders just the calendar (no time selects). */ export const ActivityDateTimeField = ({ id, @@ -47,6 +51,7 @@ export const ActivityDateTimeField = ({ isNarrow = false, label, required = false, + timeVisible = true, }: { id: string value: string @@ -60,6 +65,8 @@ export const ActivityDateTimeField = ({ label?: string /** Marks the required fields with a visible asterisk on the narrow trigger. */ required?: boolean + /** When false, hide the time selects and label the trigger with the date only. */ + timeVisible?: boolean }) => { const [open, setOpen] = useState(false) const civil = floorToMinuteStep(value) @@ -96,7 +103,9 @@ export const ActivityDateTimeField = ({ 'border-destructive ring-3 ring-destructive/20 focus-visible:border-destructive focus-visible:ring-destructive/20', )} > - {formatBahiaCivilDateTimeLabel(civil)} + + {timeVisible ? formatBahiaCivilDateTimeLabel(civil) : formatBahiaCivilDateLabel(civil)} + {isNarrow && required ? (