@uplink-protocol/calendar-controller
Version:
Flexible calendar API supporting both calendar and date-picker integrations for any JavaScript framework or library
42 lines (41 loc) • 1.46 kB
TypeScript
import { IDateValidationService } from '../interfaces/date-validation.service.interfaces';
/**
* Implementation of DateValidationService
* Responsible for date validation and constraint checking
*/
export declare class DateValidationService implements IDateValidationService {
/**
* Check if a date is disabled based on constraints
* @param date Date to check
* @param minDate Minimum allowed date
* @param maxDate Maximum allowed date
* @param disabledDates Array of specifically disabled dates
* @returns Boolean indicating if date is disabled
*/
isDateDisabled(date: Date, minDate: Date | null, maxDate: Date | null, disabledDates: Date[]): boolean;
/**
* Set minimum selectable date
* @param date Minimum date
* @returns Normalized minimum date
*/
setMinDate(date: Date | null): Date | null;
/**
* Set maximum selectable date
* @param date Maximum date
* @returns Normalized maximum date
*/
setMaxDate(date: Date | null): Date | null;
/**
* Set disabled dates
* @param dates Array of disabled dates
* @returns Normalized array of disabled dates
*/
setDisabledDates(dates: Date[]): Date[];
/**
* Check if two dates represent the same day
* @param date1 First date
* @param date2 Second date
* @returns Boolean indicating if dates are the same day
*/
isSameDay(date1: Date, date2: Date): boolean;
}