frontend/src/helpers/parseDateOrNull.js

11 lines
171 B
JavaScript

export const parseDateOrNull = date => {
if (date instanceof Date) {
return date
}
if (date && !date.startsWith('0001')) {
return new Date(date)
}
return null
}