|
|
@ -46,16 +46,18 @@ export default function convertCellData(args: { from: UITypes; to: UITypes; valu |
|
|
|
return parsedTime.format(dateFormat) |
|
|
|
return parsedTime.format(dateFormat) |
|
|
|
} |
|
|
|
} |
|
|
|
case UITypes.Year: { |
|
|
|
case UITypes.Year: { |
|
|
|
|
|
|
|
if (/^\d+$/.test(value)) { |
|
|
|
|
|
|
|
return +value |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const parsedDate = dayjs(value) |
|
|
|
const parsedDate = dayjs(value) |
|
|
|
|
|
|
|
|
|
|
|
if (!parsedDate.isValid()) { |
|
|
|
if (parsedDate.isValid()) { |
|
|
|
return parsedDate.format('YYYY') |
|
|
|
return parsedDate.format('YYYY') |
|
|
|
} |
|
|
|
} |
|
|
|
if (/^\d+$/.test(value)) { |
|
|
|
|
|
|
|
throw new Error('Not a valid year value') |
|
|
|
throw new Error('Not a valid year value') |
|
|
|
} |
|
|
|
} |
|
|
|
return value |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
case UITypes.Attachment: { |
|
|
|
case UITypes.Attachment: { |
|
|
|
let parsedVal |
|
|
|
let parsedVal |
|
|
|
try { |
|
|
|
try { |
|
|
|