@progress/kendo-angular-dateinputs
Version:
Kendo UI for Angular Date Inputs Package - Everything you need to add date selection functionality to apps (DatePicker, TimePicker, DateInput, DateRangePicker, DateTimePicker, Calendar, and MultiViewCalendar).
24 lines (23 loc) • 824 B
JavaScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { isInTimeRange } from '../util';
/**
* @hidden
*/
export const timeRangeValidator = (min, max) => {
return (control) => {
if (!min || !max || !control.value) {
return null;
}
const err = {
timeRangeError: {
maxValue: max,
minValue: min,
value: control.value
}
};
return isInTimeRange(control.value, min, max) ? null : err;
};
};