From 8ac4e8d9faa6e86ca6c7ab475efd7462d76fc9b6 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Wed, 1 Oct 2025 06:51:29 +0000
Subject: (최겸) date-picker 컴포넌트 수정(minDate?, MaxDate? 추가, 현 날짜
 기준 과거 날짜 선택 제한 기능 추가 목적으로 개발됨)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 components/ui/date-picker.tsx | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

(limited to 'components/ui/date-picker.tsx')

diff --git a/components/ui/date-picker.tsx b/components/ui/date-picker.tsx
index a88a8679..80ce6ea1 100644
--- a/components/ui/date-picker.tsx
+++ b/components/ui/date-picker.tsx
@@ -19,6 +19,8 @@ interface DatePickerProps {
   disabled?: boolean
   placeholder?: string
   className?: string
+  minDate?: Date
+  maxDate?: Date
 }
 
 export function DatePicker({
@@ -27,6 +29,8 @@ export function DatePicker({
   disabled = false,
   placeholder = "날짜 선택",
   className,
+  minDate,
+  maxDate,
 }: DatePickerProps) {
   // 내부 상태 관리와 외부 상태 관리를 모두 지원
   const [internalDate, setInternalDate] = React.useState<Date | undefined>(date)
@@ -67,7 +71,12 @@ export function DatePicker({
           selected={displayDate}
           onSelect={handleSelect}
           initialFocus
-          disabled={disabled}
+          disabled={(date) => {
+            if (disabled) return true
+            if (minDate && date < minDate) return true
+            if (maxDate && date > maxDate) return true
+            return false
+          }}
         />
       </PopoverContent>
     </Popover>
-- 
cgit v1.2.3

