You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Calendar.md
+85-6Lines changed: 85 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,7 +128,7 @@ The calendar can display a list of _Events_. Events must be resources with at le
128
128
},
129
129
```
130
130
131
-
That means that in order to be able to use `ra-calendar`, your `dataProvider` must return event-like objects for at least one resource. In case your event records don't exactly match this format, ra-calendar allows to specify [a function to convert records to Events](#converttoevent).
131
+
That means that in order to be able to use `ra-calendar`, your `dataProvider` must return event-like objects for at least one resource. In case your event records don't exactly match this format, ra-calendar allows to specify [a function to convert records to Events](#converttoevent). See [Using A Custom Event Format](#using-a-custom-event-format) for an example.
132
132
133
133
Events can have many more fields, e.g. for recurrent events, groups, colors, etc. Check the [Event format on the Full Calendar documentation](https://fullcalendar.io/docs/event-parsing).
134
134
@@ -143,7 +143,7 @@ In addition, the calendar queries a list of events in a time interval. Your data
143
143
}
144
144
```
145
145
146
-
The `ra-calendar` provides [a function to transform the display interval into a dataProvider filter](#getfiltervaluesfrominterval).
146
+
The `ra-calendar` provides [a function to transform the display interval into a dataProvider filter](#getfiltervaluesfrominterval). Again, see [Using A Custom Event Format](#using-a-custom-event-format) for an example.
147
147
148
148
## `<CompleteCalendar>`
149
149
@@ -391,6 +391,85 @@ const EventList = () => {
391
391
};
392
392
```
393
393
394
+
### Using A Custom Event Format
395
+
396
+
If your events don't match the Full Calendar event format, you can still use `<CompleteCalendar>`.
397
+
398
+
You will need to:
399
+
400
+
- Use the `convertToEvent` prop to tell `<CompleteCalendar>` how to convert the events
401
+
- Use a custom function to compute the filter values from the current date interval (called `customGetFilterValues` in our example)
402
+
- Use your own field names in the form (e.g. use `start_date` and `end_date` instead of `start` and `end`)
A wrapper around full-calendar's `<FullCalendar>` component, using react-admin's `useListContext` hook to read data, and linking to the edit and create views of the current resource. Must be used inside a `<ListContext>`.
@@ -650,14 +729,14 @@ For instance, let's say your `dataProvider` returns records like the following:
650
729
}
651
730
```
652
731
653
-
Full Calendar won't work unless you convert these rcords to events looking like the following:
732
+
Full Calendar won't work unless you convert these records to events looking like the following:
0 commit comments