Hello Paul,
Thank you for the logged feature request and feedback.
The reason for the missing feature is that the Kendo UI for Angular DatePicker and DateTimePicker require the min and max properties to be valid Date objects. Setting them to null or undefined is currently not supported.
When you need to "unset" these boundaries dynamically (for example, if they depend on another date that can be null), there is no built-in way to remove the restriction by setting min or max to null.
Workarounds for Dynamic min/max
min or max, you can programmatically set them to very early or very late dates instead of null. For example:public min: Date = condition ? new Date(2022, 6, 10) : new Date(-8640000000000000); // Earliest possible date
public max: Date = condition ? new Date(2023, 2, 10) : new Date(8640000000000000); // Latest possible date
min and max based on your business logic. For example:get dynamicMin(): Date {
return this.otherDate ? this.otherDate : new Date(-8640000000000000);
}
get dynamicMax(): Date {
return this.otherDate ? this.otherDate : new Date(8640000000000000);
}
Then bind[min]="dynamicMin"and[max]="dynamicMax"in your template.
Alternative Approach: Disabled Dates Function
disabledDates property to disable dates outside your intended range, regardless of min/max:public disabledDates = (date: Date): boolean => {
// Implement your logic here
return false; // or true to disable
};
Regards,
Martin Bechev
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.