quintodrome/ui/src/common/DateField.jsx

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
360 B
React
Raw Normal View History

2021-06-16 08:28:49 -08:00
import React from 'react'
import { isDateSet } from '../utils/validations'
2021-06-16 08:28:49 -08:00
import { DateField as RADateField } from 'react-admin'
export const DateField = (props) => {
const { record, source } = props
const value = record?.[source]
if (!isDateSet(value)) return null
2021-06-16 08:28:49 -08:00
return <RADateField {...props} />
}
DateField.defaultProps = {
addLabel: true,
}