-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable dates in the future #2
Comments
Hi @siboscol, thank you for using my component. interface DateRangePickerProps {
open: boolean;
initialDateRange?: DateRange;
definedRanges?: DefinedRange[];
minDate?: Date | string;
maxDate?: Date | string;
onChange: (dateRange: DateRange) => void;
} Above are the props taken by the picker, you can specify the minDate and maxDate prop and that will disable the dates outside of that range, it accepts both Date object and Date strings. The component currently doesn't support disabling specific dates. Feel free to submit a PR or start a discussion in this thread. |
Yes, its a 30 year span in total with today at the mid. But that is something i would like to improve and make it respect minDate and maxDate props. I will be working towards this in the coming weeks.
For now, you could set maxDate as today and not set any minDate so that gives you max range. In the future versions, i will fix the years to respect these props. Thanks. |
Thanks a lot, very useful. |
No problem. If you like to try your hands on it, you can look at changing the signature of this function to accept minDate and maxDate. |
What are peoples thoughts on adding a interface DateRangePickerProps {
open: boolean;
initialDateRange?: DateRange;
definedRanges?: DefinedRange[];
disabledRanges?:DateRange[];
minDate?: Date | string;
maxDate?: Date | string;
onChange: (dateRange: DateRange) => void;
} |
How to disable a specific dates? |
Hi,
amazing components, simple, straightforward and complete.
may I ask you if there is any way to disable dates in the future?
I'm not sure it's clear to me how to use
endDate
andstartDate
props.The text was updated successfully, but these errors were encountered: