-
Beta Was this translation helpful? Give feedback.
Answered by
gpbl
Sep 11, 2024
Replies: 1 comment 2 replies
-
Hi @RaphyRaph! Not sure I understand your question. Are you trying to implement two instances of DayPicker? Or are you referring to the select elements, e.g. displaying January - March while skipping February in the middle? To use 2 different instances of https://stackblitz.com/edit/react-day-picker-9-2332-xg4dwt?file=src%2FApp.tsx import './App.css';
import 'react-day-picker/style.css';
import { type DateRange, DayPicker } from 'react-day-picker';
import { useState } from 'react';
function App() {
const [range, setRange] = useState<DateRange | undefined>(undefined);
const [month, setMonth] = useState(new Date());
return (
<>
<DayPicker
mode="range"
month={month}
onMonthChange={setMonth}
selected={range}
onSelect={setRange}
/>
<DayPicker
mode="range"
month={month}
onMonthChange={setMonth}
selected={range}
onSelect={setRange}
/>
<button onClick={() => setRange(undefined)}>Reset</button>
</>
);
}
export default App; |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@RaphyRaph For a more complex solution, see #2453.
In your case, what about hiding the month via CSS?