Skip to content

Commit

Permalink
X2-7813 fix range date picker year select (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
SemenStruchev authored Nov 16, 2023
1 parent 21a3d45 commit e10c872
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/DatePicker/DatePicker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ export const DatePicker = ({
const [currentMonth, setCurrentMonth] = useState(initialValue);
const [startMonth, setStartMonth] = useState(value?.from);
const [endMonth, setEndMonth] = useState(
dayjs(value?.to).isSame(dayjs(value?.from), "month") ? dayjs(value?.from).add(1, "month").toDate() : value?.to,
dayjs(value?.to).isSame(dayjs(value?.from), "month")
? dayjs(value?.from).add(1, "month").toDate()
: value?.to ?? dayjs(value?.from).add(1, "month").toDate(),
);
const [rangeName, setRangeName] = useState("");
const isRangeVariant = variant === variants.range;
Expand Down

0 comments on commit e10c872

Please sign in to comment.