import { View, WeekRule } from '../types/enums'; import { ActiveViewProps, TimelineProcessedEvent, TimelineSlot, TimeSlot } from '../types/internal-interface'; import { TimeScaleProps, WorkHoursProps, EventModel } from '../types/scheduler-types'; export declare const DAYS_PER_WEEK: number; export declare const MINUTES_PER_HOUR: number; export declare const WEEK_LENGTH: number; export declare const DEFAULT_WEEKS: number; export declare const MS_PER_MINUTE: number; export declare const HOURS_PER_DAY: number; export declare const MINUTES_PER_DAY: number; export declare const MS_PER_DAY: number; export declare const MS_PER_SECOND: number; /** * Service for handling scheduler date operations * * @private */ export declare class DateService { /** * Generates a date key string in YYYY-MM-DD format * * @param {Date} date - The date to convert to a key * @returns {string} Date formatted as a string key */ static generateDateKey(date: Date): string; /** * Gets the dates to render for a specific view * * @param {View} viewType - Type of view (Day, Week, WorkWeek) * @param {Date} selectedDate - The currently selected date * @param {ActiveViewProps} activeViewProps - The current active view props * @param {Date} startCellDate - The current view start date * @param {Date} endCellDate - The current view end date * @returns {Date[]} Array of dates to render */ static getRenderDates(viewType: View, selectedDate: Date, activeViewProps: ActiveViewProps, startCellDate?: Date, endCellDate?: Date): Date[]; static getTimelineMonthRenderDates(selectedDate: Date, interval: number, workDays: number[], showWeekend: boolean): Date[]; static getRenderWeeks(renderDates: Date[], showWeekend: boolean, workDays: number[]): Date[][]; static getWeekNumber(date: Date, weekRule: WeekRule, firstDayOfWeek: number): number; static getMonthRenderDates(selectedDate: Date, interval: number, firstDayOfWeek: number, workDays: number[], showWeekend: boolean, displayDate?: Date, numberOfWeeks?: number, startCellDate?: Date, lastCellDate?: Date, useDisplayDate?: boolean): Date[]; /** * Adds the specified number of days to a date * * @param {Date} date - The date to which days will be added * @param {number} days - The number of days to add * @returns {Date} A new Date object with the days added */ static addDays(date: Date, days: number): Date; /** * Adds the specified number of months to a date * * @param {Date} date - The date to which months will be added * @param {number} months - The number of months to add * @returns {Date} A new Date object with the months added */ static addMonths(date: Date, months: number): Date; static isFullDayEvent(startTime: Date, endTime: Date): boolean; /** * Gets the first date of the month for the specified date * * @param {Date} date - The date from which to get the first date of the month * @returns {Date} A new Date object representing the first date of the month */ static firstDateOfMonth(date: Date): Date; static getWeekMiddleDate(weekFirst: Date, weekLast: Date): Date; /** * Gets the last date of the month for the specified date * * @param {Date} date - The date from which to get the last date of the month * @returns {Date} A new Date object representing the last date of the month */ static lastDateOfMonth(date: Date): Date; static getMonthStart(currentDate: Date, displayDate: Date, firstDayOfWeek: number, numberOfWeeks?: number, useDisplayDate?: boolean): Date; static getMonthEnd(currentDate: Date, displayDate: Date, firstDayOfWeek: number, numberOfWeeks: number, interval: number, useDisplayDate?: boolean): Date; /** * Gets the number of days in the month for the specified date * * @param {number} month - The month (0-11) * @param {number} year - The year * @returns {number} The number of days in the month */ static getDaysInMonth(month: number, year: number): number; /** * Gets the week number for the specified date * * @param {Date} date - The date for which to get the week number * @returns {number} The week number */ static getWeekNumberValue(date: Date): number; /** * Gets the number of days between two dates * * @param {Date} startDate - The start date * @param {Date} endDate - The end date * @param {boolean} isAllday - Denotes event is all day. * @returns {number} The number of days between the dates */ static getDaysCount(startDate: Date, endDate: Date, isAllday?: boolean): number; /** * Gets the first day of the week for the specified date * * @param {Date} date - The date from which to get the first day of the week * @param {number} firstDayOfWeek - The first day of the week (0 for Sunday, 1 for Monday, etc.) * @returns {Date} A new Date object representing the first day of the week */ static getWeekFirstDate(date: Date, firstDayOfWeek: number): Date; /** * Gets the last day of the week for the specified date * * @param {Date} date - The date from which to get the last day of the week * @param {number} firstDayOfWeek - The first day of the week (0 for Sunday, 1 for Monday, etc.) * @returns {Date} A new Date object representing the last day of the week */ static getWeekLastDate(date: Date, firstDayOfWeek: number): Date; /** * Checks if two dates are in the same month * * @param {Date} date1 - The first date * @param {Date} date2 - The second date * @returns {boolean} True if the dates are in the same month, false otherwise */ static isSameMonth(date1: Date, date2: Date): boolean; /** * Checks if two dates are on the same day * * @param {Date} date1 - The first date * @param {Date} date2 - The second date * @returns {boolean} True if the dates are on the same day, false otherwise */ static isSameDay(date1: Date, date2: Date): boolean; /** * Checks if date is on mid night * * @param {Date} date - The date * @returns {boolean} True if the date on mid night, false otherwise */ static isMidnight(date: Date): boolean; static isLessthan24Hours(startTime: Date, endTime: Date): boolean; /** * Parses a time string into hours and minutes * * @param {string} timeString - The time string to parse (e.g., '09:00') * @returns {Object} An object with hours and minutes */ static parseTimeString(timeString: string): { hours: number; minutes: number; }; /** * Creates a date with the specified time * * @param {Date} date - The base date * @param {string} timeString - The time string to set (e.g., '09:00') * @returns {Date} A new Date object with the specified time */ static createDateWithTime(date: Date, timeString: string): Date; static combineDateAndTime(date?: Date, time?: Date): Date | undefined; /** * Checks if a date is a weekend * * @param {Date} date - The date to check * @param {number[]} workDays - The work days (0 for Sunday, 1 for Monday, etc.) * @returns {boolean} True if the date is a weekend, false otherwise */ static isWeekend(date: Date, workDays: number[]): boolean; /** * Checks if a date is within the specified work days * * @param {Date} date - The date to check * @param {number[]} workDays - The work days (0 for Sunday, 1 for Monday, etc.) * @returns {boolean} True if the date is a work day, false otherwise */ static isWorkDay(date: Date, workDays: number[]): boolean; /** * Check if a date is the current date * * @param {Date} date - The date to check * @returns {boolean} True if it's the current date */ static isToday(date: Date): boolean; /** * Checks if a date is within work hours * * @param {Date} date - The date to check * @param {WorkHoursProps} workHours - The work hours configuration * @param {number[]} workDays - The work days (0 for Sunday, 1 for Monday, etc.) * @returns {boolean} True if the date is within work hours, false otherwise */ static isWorkHour(date: Date, workHours: WorkHoursProps, workDays: number[]): boolean; /** * Gets a date object for a time string, handling special cases * * @param {string} timeString - The time string (e.g., '09:00', '24:00') * @returns {Date} A date object with the correct time set */ static getStartEndHours(timeString?: string): Date; static getSchedulerStartAndEndMinutes(startHour: string, endHour: string): { schedulerStartMinutes: number; schedulerEndMinutes: number; }; static getEventRange(evt: TimelineProcessedEvent): { start: Date; end: Date; }; /** * Normalizes a date by removing time components * * @param {Date} date - The date to normalize * @returns {Date} A new date with time component set to midnight */ static normalizeDate(date: Date): Date; /** * Converts a date's time portion (hours and minutes) to absolute minutes from midnight. * Use this for time-of-day math such as overlap detection, slot snapping, and view-boundary * calculations. Returns `NaN` for null/invalid inputs so that invalidity propagates naturally * to downstream calculations (mirroring the prior inline `getHours() * 60 + getMinutes()` behavior). * * @param {Date | null | undefined} date - The date whose time-of-day is converted * @returns {number} Minutes from midnight (0-1439), or `NaN` when `date` is null/invalid */ static getTimeOfDayInMinutes(date: Date | null | undefined): number; /** * Reassign a time from required time components * * @param {Date} newTime - The time to set hours * @param {Date} setTimeFrom - The time to get hours * @returns {void} */ static setHours(newTime: Date, setTimeFrom: Date): void; /** * Reassign a year from required year components * * @param {Date} newYear - The time to set year * @param {Date} setYearFrom - The time to get year * @returns {void} */ static setYear(newYear: Date, setYearFrom: Date): void; /** * Method to get date object from date string * * @param {string} date Accepts the date string * @returns {Date} Returns the date object */ static getDateFromString(date: string): Date; /** * Formats the start date of a date range based on context * * @param {string} locale - The locale to use for formatting * @param {Date} date - The date to format * @param {Date} endDate - The end date (for context) * @param {string} format - Base format type ('d' for day-first, 'm' for month-first) * @param {string} mode - Calendar mode * @returns {string} Formatted start date string */ static formatRangeStart(locale: string, date: Date, endDate: Date, format: string, mode?: string): string; /** * Formats the end date of a date range based on context * * @param {string} locale - The locale to use for formatting * @param {Date} date - The date to format * @param {Date} startDate - The start date (for context) * @param {string} format - Base format type ('d' for day-first, 'm' for month-first) * @param {string} mode - Calendar mode * @returns {string} Formatted end date string */ static formatRangeEnd(locale: string, date: Date, startDate: Date, format: string, mode?: string): string; /** * Sorts events by start time ascending, then by duration descending when start times are equal. * * @param {EventModel[]} events - Array of events to sort; each should include a startTime and may include an endTime. * @returns {EventModel[]} The sorted array reference, ordered by start time (ASC) then duration (DESC). */ static sortByTimeAndSpan: (events: EventModel[]) => EventModel[]; static formatTimeDisplay(event: EventModel, locale: string, timeFormat: string): string; /** * Capitalizes the first word of a string based on the specified type * * @param {string} inputString - The string to capitalize * @param {'single' | 'multiple'} type - The type of capitalization ('single' or 'multiple') * @returns {string} The capitalized string */ static capitalizeFirstWord(inputString: string, type: 'single' | 'multiple'): string; /** * Method that formats a date range as a string * * @param {string} locale The locale to use for formatting * @param {Date} startDate The start date * @param {Date} endDate The end date * @param {string} customDateFormat Optional custom date format * @returns {string} Returns the formatted date range */ static formatDateRange(locale: string, startDate: Date, endDate?: Date, customDateFormat?: string): string; static setValidDate(date: Date | number): Date; static setValidFirstDayOfWeek(viewFirstDayOfWeek?: number, rootFirstDayOfWeek?: number): number; static getMonthRangeText(selectedDate: Date, interval: number, displayDate: Date, numberOfWeeks: number, dateFormat: string, renderDates: Date[], locale: string): string; /** * Generates a human-readable string for the date range with time display. * * @param {EventModel} eventData Start date and time * @param {string} locale Locale string for formatting * @param {string} timeFormat Optional time format * @returns {string} Formatted date range string */ static formatPopupDateRange(eventData: EventModel, locale: string, timeFormat?: string): string; /** * Gets localized month names from CLDR data * * @param {string} locale The locale string * @returns {string[]} Array of localized month names */ static getMonthNames(locale: string): string[]; static getVisibleAndStartDays(renderDates: Date[], eventStartDay: Date, eventEndDay: Date, originalEvent: EventModel): { visibleDayCount: number; startDayIndex: number; }; static formatStartAndEndDateRange(start: Date, end: Date, locale?: string): string; static resetTime(date: Date): Date; /** * Converts the given date string into a `Date` object and returns in `HH:mm` format. * * @param {string} hour - The date string from which the time should be normalized. * @returns {string} A formatted time string in `HH:mm` format */ static normalizeTime: (hour: string) => string; /** * Returns the display time adjusted for the scheduler timezone when provided. * * @param {string} timezone Optional timezone identifier * @returns {Date} Date adjusted to display timezone if provided, otherwise the base date */ static getCurrentTime(timezone?: string): Date; /** * Generates core slot metadata shared by vertical and timeline views. * * @param {string} startHour - Start hour in HH:mm format * @param {string} endHour - End hour in HH:mm format * @param {number} interval - Interval in minutes between slots * @param {number} slotCount - Number of slots to generate * @returns {TimeSlot[]} Array of time slot metadata */ static getSlotMetadata(startHour: string, endHour: string, interval: number, slotCount: number): TimeSlot[]; static getTimelineSlots(view: View | string, startHour?: string, endHour?: string, timeScale?: TimeScaleProps, timeFormat?: string, locale?: string): { timeSlots: TimelineSlot[]; slotCount: number; }; }