This repository has been archived on 2024-02-08. You can view files and clone it, but cannot push or open issues or pull requests.
frontend/src/helpers/parseDateOrNull.js
konrad c8209c6c10
All checks were successful
continuous-integration/drone/push Build is passing
Quick add magic for tasks (#570)
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: #570
Co-authored-by: konrad <konrad@kola-entertainments.de>
Co-committed-by: konrad <konrad@kola-entertainments.de>
2021-07-05 10:29:04 +00:00

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
}