Skip to content

Commit

Permalink
refactor(calltaker/date-time-picker): Bypass attempt to format() empt…
Browse files Browse the repository at this point in the history
…y string.
  • Loading branch information
binh-dam-ibigroup committed Sep 21, 2023
1 parent 107e6a2 commit 803b9b1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/components/form/call-taker/date-time-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ const SUPPORTED_TIME_FORMATS = [
'HH:mm'
]

const safeFormat = (date: Date | string, time: string, options: any) => {
const safeFormat = (date: Date | '', time: string, options: any) => {
if (date === '') return ''
try {
return format(date, time, options)
} catch (e) {
Expand Down

0 comments on commit 803b9b1

Please sign in to comment.