@uplink-protocol/calendar-controller
Version:
Flexible calendar and time picker API supporting both calendar, date-picker, and time-picker integrations for any JavaScript framework or library
65 lines (64 loc) • 2.03 kB
TypeScript
import { CalendarStateManager } from "./state-manager";
import { IConstraintsService, IAccessibilityService, ICalendarService } from "../interfaces";
/**
* UtilityCoordinator - Handles utility methods and queries
*/
export declare class UtilityCoordinator {
private stateManager;
private constraintsService;
private accessibilityService;
private calendarService;
constructor(stateManager: CalendarStateManager, constraintsService: IConstraintsService, accessibilityService: IAccessibilityService, calendarService: ICalendarService);
/**
* Check if a date is disabled
*/
isDateDisabled(date: Date): boolean;
/**
* Check if a date is today
*/
isToday(date: Date): boolean;
/**
* Get week number for a date
*/
getWeekNumber(date: Date): number;
/**
* Get disabled dates
*/
getDisabledDates(): Date[];
/**
* Get disabled days of week
*/
getDisabledDaysOfWeek(): number[];
/**
* Get accessible date label
*/
getAccessibleDateLabel(date: Date, getMonthName: (month: number) => string): string;
/**
* Get date state description
*/
getDateStateDescription(date: Date, isDateDisabledFn: (date: Date) => boolean, isTodayFn: (date: Date) => boolean): string;
/**
* Check if a date is within a date range
*/
isDateInRange(date: Date, startDate: Date | null, endDate: Date | null): boolean;
/**
* Check if two dates are the same day
*/
isSameDay(date1: Date, date2: Date): boolean;
/**
* Check if two dates are in the same month
*/
isSameMonth(date1: Date, date2: Date): boolean;
/**
* Check if two dates are in the same year
*/
isSameYear(date1: Date, date2: Date): boolean;
/**
* Get day of week for a date (0 = Sunday, 1 = Monday, etc.)
*/
getDayOfWeek(date: Date): number;
/**
* Get number of days in a specific month and year
*/
getDaysInMonth(year: number, month: number): number;
}