🐞 - DateRange
+ minLength
/ maxLength
(with month
/ year
params) has incorrect limits #1884
Open
Description
opened on Dec 4, 2024
Which package(s) are the source of the bug?
@maskito/kit
Playground Link
https://maskito.dev/kit/date-range/API?maxLength$=1
Description
Reproduction
Case 1
- Open https://maskito.dev/kit/date-range/API?maxLength$=1 (
maxLength: {month: 1}
) - Enter
01.01.2025 – 01.02.2025
Expected behavior: 31.01.2025
is max allowed end of date range
Actual behavior: mask allows to enter 01.02.2025
Case 2
- Open https://maskito.dev/kit/date-range/API?maxLength$=1 (
maxLength: {month: 1}
) - Enter
31.01.2025 – 03.03.2025
Expected behavior: 27.02.2025
is max allowed end of date range
Actual behavior: mask allows to enter 03.03.2025
Why the current behavior is incorrect ?
Explore Taiga UI's CalendarRange
behavior:
https://taiga-ui.dev/components/calendar-range/API?maxLength$=1 (maxLength: {month: 1}
)
calendar-range.mov
How to solve this issue ?
Modify the following logic
maskito/projects/kit/src/lib/utils/date/append-date.ts
Lines 3 to 21 in 802972a
to satisfy Taiga UI behavior.
Maskito version
3.2.0
Which browsers have you used?
- Chrome
- Firefox
- Safari
- Edge
Which operating systems have you used?
- macOS
- Windows
- Linux
- iOS
- Android
Activity