Don't show "empty" dates

This commit is contained in:
Deluan
2021-06-16 12:28:49 -04:00
parent e0fd1c6ad8
commit c4623d7bc3
4 changed files with 16 additions and 3 deletions
+13
View File
@@ -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,
}
+1
View File
@@ -3,6 +3,7 @@ export * from './ArtistLinkField'
export * from './BatchPlayButton'
export * from './BitrateField'
export * from './ContextMenus'
export * from './DateField'
export * from './DocLink'
export * from './DurationField'
export * from './List'