From 4d0881b504fd48caedaeae46863c562203cc7af6 Mon Sep 17 00:00:00 2001 From: baegofda Date: Fri, 5 Jan 2024 21:30:01 +0900 Subject: [PATCH] =?UTF-8?q?(#0)=20afterAllDate=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/components/Input/InputDatePicker/index.tsx | 3 ++- src/core/components/Input/InputDatePicker/types/index.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/components/Input/InputDatePicker/index.tsx b/src/core/components/Input/InputDatePicker/index.tsx index 6c46f18..0ba609f 100644 --- a/src/core/components/Input/InputDatePicker/index.tsx +++ b/src/core/components/Input/InputDatePicker/index.tsx @@ -22,6 +22,7 @@ const InputDatePicker = ({ required = false, className, inputClassName, + afterAllDate, label, }: InputDatePickerProps & HTMLAttributes) => { const id = useId(); @@ -80,7 +81,7 @@ const InputDatePicker = ({ type = "text" placeholder = "날짜를 입력해주세요" className = {clsx("flex-1 focus-visible:outline-0 cursor-pointer pointer-events-none", inputClassName)} - value = {periodDates.startDate && `${startDate}${periodDates.endDate && ` - ${endDate}`}`} + value = {periodDates.startDate && (!afterAllDate ? `${startDate}${periodDates.endDate && ` - ${endDate}`}` : `${startDate} ~`)} onKeyDown = {() => false} onFocus = {(e: React.FocusEvent) => e.target.blur()} onChange = {() => {}} diff --git a/src/core/components/Input/InputDatePicker/types/index.ts b/src/core/components/Input/InputDatePicker/types/index.ts index 47ad299..bcc53b1 100644 --- a/src/core/components/Input/InputDatePicker/types/index.ts +++ b/src/core/components/Input/InputDatePicker/types/index.ts @@ -1,6 +1,6 @@ import { DatePickerCalendarProps, PeriodDates } from "@/core/components/Calendar/DatePickerCalendar/types/DatePickerCalendarProps"; -export interface DatePickerProps extends Pick { +export interface DatePickerProps extends Pick { variants?: DatePickerCalendarProps["variants"]; externalDates?: PeriodDates; isOpen: boolean;