diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-04-02 09:54:08 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-04-02 09:54:08 +0000 |
| commit | dfdfae3018f8499240f48d28ce634f4a5c56e006 (patch) | |
| tree | 4493b172c061fa5bf4e94c083788110eb1507f6d /lib/utils.ts | |
| parent | 21a72eeddc74cf775e2a76e2c569de970bd62a7f (diff) | |
벤더 코멘트 처리
Diffstat (limited to 'lib/utils.ts')
| -rw-r--r-- | lib/utils.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/utils.ts b/lib/utils.ts index 2eca9285..af9df057 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -28,10 +28,15 @@ export function formatDate( // Alternative: Create a separate function for date and time export function formatDateTime( - date: Date | string | number, + date: Date | string | number| null | undefined, locale: string = "en-US", opts: Intl.DateTimeFormatOptions = {} ) { + + if (date === null || date === undefined || date === '') { + return ''; // 또는 '-', 'N/A' 등 원하는 기본값 반환 + } + return new Intl.DateTimeFormat(locale, { month: opts.month ?? "long", day: opts.day ?? "numeric", |
