@@ -33,7 +33,7 @@ const AuthorShow = () => (
3333 < ReferenceManyField label= " Books" reference= " books" target= " author_id" >
3434 < Datagrid>
3535 < TextField source= " title" / >
36- < TextField source= " year " / >
36+ < DateField source= " published_at " / >
3737 < / Datagrid>
3838 < / ReferenceManyField>
3939 < / SimpleShowLayout>
@@ -52,7 +52,7 @@ This component fetches a list of referenced records by a reverse lookup of the c
5252For instance, here is how to show the title of the books written by a particular author in a show view.
5353
5454``` jsx
55- import { Show , SimpleShowLayout , TextField , ReferenceManyField , Datagrid } from ' react-admin' ;
55+ import { Show , SimpleShowLayout , TextField , ReferenceManyField , Datagrid , DateField } from ' react-admin' ;
5656
5757export const AuthorShow = () => (
5858 < Show>
@@ -63,7 +63,7 @@ export const AuthorShow = () => (
6363 < ReferenceManyField label= " Books" reference= " books" target= " author_id" >
6464 < Datagrid>
6565 < TextField source= " title" / >
66- < TextField source= " year " / >
66+ < DateField source= " published_at " / >
6767 < / Datagrid>
6868 < / ReferenceManyField>
6969 < / SimpleShowLayout>
@@ -128,7 +128,7 @@ This example leverages [`<SingleFieldList>`](./SingleFieldList.md) to display an
128128For instance, use a ` <Datagrid> ` to render the related records in a table:
129129
130130``` jsx
131- import { Show , SimpleShowLayout , TextField , ReferenceManyField , Datagrid } from ' react-admin' ;
131+ import { Show , SimpleShowLayout , TextField , ReferenceManyField , Datagrid , DateField } from ' react-admin' ;
132132
133133export const AuthorShow = () => (
134134 < Show>
@@ -139,7 +139,7 @@ export const AuthorShow = () => (
139139 < ReferenceManyField label= " Books" reference= " books" target= " author_id" >
140140 < Datagrid>
141141 < TextField source= " title" / >
142- < TextField source= " year " / >
142+ < DateField source= " published_at " / >
143143 < / Datagrid>
144144 < / ReferenceManyField>
145145 < / SimpleShowLayout>
@@ -150,7 +150,7 @@ export const AuthorShow = () => (
150150Or [ ` <WithListContext> ` ] ( ./WithListContext.md ) to render the related records in a custom way:
151151
152152``` jsx
153- import { Show , SimpleShowLayout , TextField , ReferenceManyField , WithListContext } from ' react-admin' ;
153+ import { Show , SimpleShowLayout , TextField , ReferenceManyField , WithListContext , DateField } from ' react-admin' ;
154154
155155export const AuthorShow = () => (
156156 < Show>
@@ -197,7 +197,7 @@ By default, `<SimpleShowLayout>`, `<Datagrid>` and other layout components infer
197197< ReferenceManyField reference= " books" target= " author_id" >
198198 < Datagrid>
199199 < TextField source= " title" / >
200- < TextField source= " year " / >
200+ < DateField source= " published_at " / >
201201 < / Datagrid>
202202< / ReferenceManyField>
203203```
@@ -208,7 +208,7 @@ That's why you often need to set an explicit `label` on a `<ReferenceField>`:
208208< ReferenceManyField label= " Books" reference= " books" target= " author_id" >
209209 < Datagrid>
210210 < TextField source= " title" / >
211- < TextField source= " year " / >
211+ < DateField source= " published_at " / >
212212 < / Datagrid>
213213< / ReferenceManyField>
214214```
@@ -219,7 +219,7 @@ React-admin uses [the i18n system](./Translation.md) to translate the label, so
219219< ReferenceManyField label= " resources.authors.fields.books" reference= " books" target= " author_id" >
220220 < Datagrid>
221221 < TextField source= " title" / >
222- < TextField source= " year " / >
222+ < DateField source= " published_at " / >
223223 < / Datagrid>
224224< / ReferenceManyField>
225225```
@@ -256,7 +256,7 @@ For instance, if you want to display the `books` of a given `author`, the `refer
256256< ReferenceManyField label= " Books" reference= " books" target= " author_id" >
257257 < Datagrid>
258258 < TextField source= " title" / >
259- < TextField source= " year " / >
259+ < DateField source= " published_at " / >
260260 < / Datagrid>
261261< / ReferenceManyField>
262262```
@@ -299,7 +299,7 @@ Name of the field carrying the relationship on the referenced resource. For inst
299299< ReferenceManyField label= " Books" reference= " books" target= " author_id" >
300300 < Datagrid>
301301 < TextField source= " title" / >
302- < TextField source= " year " / >
302+ < DateField source= " published_at " / >
303303 < / Datagrid>
304304< / ReferenceManyField>
305305```
@@ -335,4 +335,4 @@ In these cases, use [the `<ReferenceOneField>` component](./ReferenceOneField.md
335335 < NumberField source= " price" / >
336336< / ReferenceOneField>
337337```
338- {% endraw %}
338+ {% endraw %}
0 commit comments