Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doc] Fix <DateRangeInput> import syntax #10399

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions docs/DateRangeInput.md
Original file line number Diff line number Diff line change
@@ -9,14 +9,20 @@ This [Enterprise Edition](https://react-admin-ee.marmelab.com)<img class="icon"

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

**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.
**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:

```sh
npm install --save @mui/x-date-pickers-pro
# or
yarn add @mui/x-date-pickers-pro
```

## Usage

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

```tsx
import { DateRangeInput } from '@react-admin/ra-form-layout';
import { DateRangeInput } from '@react-admin/ra-form-layout/DateRangeInput';
import { Edit, SimpleForm } from 'react-admin';

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

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