Merged in feat/sw-3134-daypicker (pull request #2495)

feat(SW-3134): Fix first day of month disabled

* feat(SW-3134): Fix first day of month disabled

* Fixed single daypicker


Approved-by: Bianca Widstam
This commit is contained in:
Linus Flood
2025-07-01 12:57:57 +00:00
parent 03b8d8eac6
commit f2b81b8c7a
4 changed files with 4 additions and 8 deletions

View File

@@ -33,7 +33,6 @@ export default function DatePickerRangeMobile({
const [autoScrollEnabled, setAutoScrollEnabled] = useState(true)
const currentDate = dt().toDate()
const startOfCurrentMonth = dt(currentDate).set("date", 1).toDate()
const yesterday = dt(currentDate).subtract(1, "day").toDate()
useEffect(() => {
if (!monthsRef.current || !selectedRange?.from || !autoScrollEnabled) return
@@ -84,7 +83,7 @@ export default function DatePickerRangeMobile({
weekday: `${classNames.weekday} ${styles.weekDay}`,
}}
disabled={[
{ from: startOfCurrentMonth, to: yesterday },
{ from: undefined, to: yesterday },
{ from: endDate, to: endOfLastMonth },
]}
endMonth={endDate}