Skip to content

Commit e97c246

Browse files
committed
fix :build 오류 해결
1 parent 050af0d commit e97c246

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/pages/events/components/DateTag.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { cva, type VariantProps } from 'class-variance-authority';
44
import { cn } from '@/shared/lib';
55

66
interface DateTagProps extends VariantProps<typeof dateTagStyle> {
7-
startDate: string;
8-
endDate: string;
7+
startDate?: string;
8+
endDate?: string;
99
className?: string;
1010
}
1111

@@ -26,7 +26,13 @@ export default function DateTag({
2626
endDate,
2727
className,
2828
}: DateTagProps) {
29-
const formatDate = (date: string) => date.replace(/-/g, '.');
29+
const formatDate = (date?: string) => {
30+
if (!date) return '';
31+
return date.replace(/-/g, '.');
32+
};
33+
34+
if (!startDate && !endDate) return null;
35+
3036
return (
3137
<div className={cn(dateTagStyle(), className)}>
3238
{formatDate(startDate)} ~ {formatDate(endDate)}

0 commit comments

Comments
 (0)