Don't show "empty" dates
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import React from 'react'
|
||||
import { DateField as RADateField } from 'react-admin'
|
||||
|
||||
export const DateField = (props) => {
|
||||
const { record, source } = props
|
||||
const value = record?.[source]
|
||||
if (value === '0001-01-01T00:00:00Z' || value === null) return null
|
||||
return <RADateField {...props} />
|
||||
}
|
||||
|
||||
DateField.defaultProps = {
|
||||
addLabel: true,
|
||||
}
|
||||
Reference in New Issue
Block a user