diff options
Diffstat (limited to 'lib/bidding/list')
| -rw-r--r-- | lib/bidding/list/biddings-table-columns.tsx | 20 | ||||
| -rw-r--r-- | lib/bidding/list/edit-bidding-sheet.tsx | 14 |
2 files changed, 19 insertions, 15 deletions
diff --git a/lib/bidding/list/biddings-table-columns.tsx b/lib/bidding/list/biddings-table-columns.tsx index 907115b1..9b8c19c5 100644 --- a/lib/bidding/list/biddings-table-columns.tsx +++ b/lib/bidding/list/biddings-table-columns.tsx @@ -256,23 +256,17 @@ export function getBiddingsColumns({ setRowAction }: GetColumnsProps): ColumnDef if (!startDate || !endDate) return <span className="text-muted-foreground">-</span> - const now = new Date().toString() - console.log(now, "now") - const startIso = new Date(startDate).toISOString() - const endIso = new Date(endDate).toISOString() + const startObj = new Date(startDate) + const endObj = new Date(endDate) + + // UI 표시용 KST 변환 + const formatKst = (d: Date) => new Date(d.getTime() + 9 * 60 * 60 * 1000).toISOString().slice(0, 16).replace('T', ' ') - const isActive = new Date(now) >= new Date(startIso) && new Date(now) <= new Date(endIso) - console.log(isActive, "isActive") - const isPast = new Date(now) > new Date(endIso) - console.log(isPast, "isPast") return ( <div className="text-xs"> - <div className={`${isActive ? 'text-green-600 font-medium' : isPast ? 'text-red-600' : 'text-gray-600'}`}> - {new Date(startDate).toISOString().slice(0, 16).replace('T', ' ')} ~ {new Date(endDate).toISOString().slice(0, 16).replace('T', ' ')} + <div> + {formatKst(startObj)} ~ {formatKst(endObj)} </div> - {isActive && ( - <Badge variant="default" className="text-xs mt-1">진행중</Badge> - )} </div> ) }, diff --git a/lib/bidding/list/edit-bidding-sheet.tsx b/lib/bidding/list/edit-bidding-sheet.tsx index ed3d3f41..23f76f4a 100644 --- a/lib/bidding/list/edit-bidding-sheet.tsx +++ b/lib/bidding/list/edit-bidding-sheet.tsx @@ -367,7 +367,12 @@ export function EditBiddingSheet({ <FormItem> <FormLabel>계약 시작일</FormLabel> <FormControl> - <Input type="date" {...field} /> + <Input + type="date" + {...field} + min="1900-01-01" + max="2100-12-31" + /> </FormControl> <FormMessage /> </FormItem> @@ -381,7 +386,12 @@ export function EditBiddingSheet({ <FormItem> <FormLabel>계약 종료일</FormLabel> <FormControl> - <Input type="date" {...field} /> + <Input + type="date" + {...field} + min="1900-01-01" + max="2100-12-31" + /> </FormControl> <FormMessage /> </FormItem> |
