Skip to content

Commit 9b51047

Browse files
authored
Merge pull request marmelab#10399 from marmelab/Fix/DateRangeInput_doc_import
Fix `DateRangeInput` doc import
2 parents 0bd08ae + 8a4ec6b commit 9b51047

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

docs/DateRangeInput.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,20 @@ This [Enterprise Edition](https://react-admin-ee.marmelab.com)<img class="icon"
99

1010
![DateRangeInput](./img/DateRangeInput.png)
1111

12-
**Note**: `<DateRangeInput>` is a wrapper around the [Material UI X Date Range Picker](https://mui.com/x/react-date-pickers/date-range-picker/), which is a MUI X Pro package. This means that you need to own a [MUI X Pro license](https://mui.com/x/introduction/licensing/#pro-plan) to use it.
12+
**Note**: `<DateRangeInput>` is a wrapper around the [Material UI X Date Range Picker](https://mui.com/x/react-date-pickers/date-range-picker/), which is a MUI X Pro package. This means that you need to own a [MUI X Pro license](https://mui.com/x/introduction/licensing/#pro-plan) to use it and install the package:
13+
14+
```sh
15+
npm install --save @mui/x-date-pickers-pro
16+
# or
17+
yarn add @mui/x-date-pickers-pro
18+
```
1319

1420
## Usage
1521

1622
Use `<DateRangeInput>` inside a form component (`<SimpleForm>`, `<TabbedForm>`, `<LongForm>`, etc.) to allow users to pick a start and an end date.
1723

1824
```tsx
19-
import { DateRangeInput } from '@react-admin/ra-form-layout';
25+
import { DateRangeInput } from '@react-admin/ra-form-layout/DateRangeInput';
2026
import { Edit, SimpleForm } from 'react-admin';
2127

2228
export const EventEdit = () => (
@@ -106,7 +112,7 @@ import {
106112
SimpleForm,
107113
TextInput,
108114
} from "react-admin";
109-
import { DateRangeInput } from '@react-admin/ra-form-layout';
115+
import { DateRangeInput } from '@react-admin/ra-form-layout/DateRangeInput';
110116

111117
const requiredValues = dates =>
112118
!dates || isEmpty(dates[0]) || isEmpty(dates[1])

0 commit comments

Comments
 (0)