Skip to content

Commit

Permalink
Format date-picker/README.md with prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
acusti committed Mar 22, 2024
1 parent 1f89c7b commit f9b4538
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/date-picker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,17 @@ yarn add @acusti/date-picker

### Example

To render a two-up date picker for selecting date ranges, handling date selections via the `onChange` prop and showing months using abbreviations:
To render a two-up date picker for selecting date ranges, handling date
selections via the `onChange` prop and showing months using abbreviations:

```tsx
import { DatePicker } from '@acusti/date-picker';
import { useCallback, useState } from 'react';

function Popover() {
const [dateRangeStart, setDateRangeStart] = useState<null | string>(null);
const [dateRangeStart, setDateRangeStart] = useState<null | string>(
null,
);
const [dateRangeEnd, setDateRangeEnd] = useState<null | string>(null);

const handleDateRangeChange = useCallback(({ dateEnd, dateStart }) => {
Expand All @@ -47,7 +50,7 @@ function Popover() {
onChange={handleDateRangeChange}
useMonthAbbreviations
/>
)
);
}
```

Expand Down

0 comments on commit f9b4538

Please sign in to comment.