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
|`sx`| - |`SxProps`| - | The style to apply to the component. |
57
57
|`validate`| - | `function|Array` | - | Validation rules for the input. See the [Validation Documentation](./Validation.md#per-input-validation-built-in-field-validators) for details. |
58
58
59
-
`<DateRangeInput>` also accept the same props as [MUI X's `<DateRangePicker>`](https://mui.com/x/api/date-pickers/date-range-picker/), except for the `format` prop (renamed `mask`),
59
+
`<DateRangeInput>` also accept the same props as [MUI X's `<DateRangePicker>`](https://mui.com/x/api/date-pickers/date-range-picker/), except for the `format` prop (renamed `mask`),
60
60
61
61
**Tip:** Since `<DateRangeInput>` stores its value as a date array, [react-admin's validators](./Validation.md#per-input-validation-built-in-field-validators) like `minValue` or `maxValue` won't work out of the box.
62
62
@@ -142,6 +142,44 @@ const EventEdit = () => {
142
142
};
143
143
```
144
144
145
+
## Using `<DateRangeInput>` as a Filter
146
+
147
+
`<DateRangeInput>` can also be used to filter a `<List>`.
148
+
149
+
However, by default, `<DateRangeInput>` returns `Date` objects with their time set to 00:00:00, which makes the upper bound *exclusive*. Usually, users will expect the upper bound to be *inclusive*.
150
+
151
+
This can be achieved by providing a `parse` function that sets the time of the upper bound to 23:59:59.
MUI X Pickers need to be wrapped in a [LocalizationProvider](https://mui.com/components/pickers/#localization) to work properly. `<DateRangeInput>` already includes a default `<LocalizationProvider>` using the `date-fns` adapter and the `enUS` locale.
@@ -171,4 +209,4 @@ export const App = () => (
171
209
172
210
**Note:** React-admin only supports the `date-fns` adapter for now.
173
211
174
-
**Tip**: React-admin already depends on `date-fns` v3 but your package manager may require you to add it to your dependencies.
212
+
**Tip**: React-admin already depends on `date-fns` v3 but your package manager may require you to add it to your dependencies.
0 commit comments