UNPKG

@asadi/angular-date-components

Version:

`Angular Date Components` is a comprehensive angular library of date-related components designed to meet the needs of applications that require localization based on various calendar systems. While the package currently includes two powerful components (S

31 lines (30 loc) 1.36 kB
import { ADCISchedulerEvent } from "../interface.global"; /** * Utility class for handling event-related operations within a scheduler. * This class provides methods for filtering events based on a date range. */ export declare class ADCSchedulerEventTools { private readonly tools; /** * Filters events that fall within a given date range. * This method checks whether the start date or end date of an event falls within the specified range. * It returns an array of events that are within the date range or span across it. * * @param startDate - The start date of the date range to filter by. * @param endDate - The end date of the date range to filter by. * @param events - An array of events to be filtered. * * @returns An array of events that fall within or span across the given date range. * * @example * ```typescript * const events: ADCISchedulerEvent[] = [ * { startDate: '2024-11-01', endDate: '2024-11-02', title: 'Event 1' }, * { startDate: '2024-11-03', endDate: '2024-11-04', title: 'Event 2' }, * ]; * const filteredEvents = schedulerEventTools.getEventsBetweenDateRange('2024-11-01', '2024-11-03', events); * console.log(filteredEvents); // Outputs events within the range * ``` */ getEventsBetweenDateRange(startDate: string, endDate: string, events: ADCISchedulerEvent[] | null): ADCISchedulerEvent[]; }