@abbl/material-calendar
Version:
Calendar component build with React and Material-UI
43 lines (42 loc) • 1.21 kB
TypeScript
import { EventStorage } from '../../../common/api/EventStorage';
export declare enum DateRange {
DAY = 0,
WEEK = 1,
MONTH = 2,
YEAR = 3,
YEARS = 4
}
/**
* Class used to check if closest DayRange to interval provided
* by user is filled with empty arrays.
*
* @privateRemarks
* The idea of strict DateRanges might not be the most flexible
* one, since it was made based on default views provided by calendar.
* Might need a little refractor in future if custom views will require it.
*
* @internal
*/
export default class EventStoragePresenceHelper {
/**
* Checks if each day in determined DateRange has array assigned to it.
*
* @param from
* @param till
* @param eventStorage
*
* @returns true if data is present.
*/
static isDataPresent(from: Date, till: Date, eventStorage: EventStorage): boolean;
/**
* Returns first DateRange that given interval fits between.
*
* @param from
* @param till
*/
static determineRange(from: Date, till: Date): DateRange;
private static isDayPresent;
private static isWeekPresent;
private static isMonthPresent;
private static isYearPresent;
}