UNPKG

react-availability-calendar

Version:

A customizable React component for displaying booking availabilities on a calendar.

32 lines (31 loc) 1.72 kB
import { Range, MsSinceMidnightRange, AvailabilityEvent, Booking } from '../types'; import { MomentCtrFunc } from '../moment-types/moment-subset'; export declare function createUtils(moment: MomentCtrFunc): { msInHour: number; datesEqual: (d1: Date, d2: Date) => boolean; formatAsMonth: (date: Date) => string; sameMonth: (d1: Date, d2: Date) => boolean; formatAsDateWithTime: (date: Date) => string; formatAsDateJustTime: (date: Date) => string; formatAsDate: (date: Date) => string; shouldHideWeek: (selectedDate: Date | null, week: Date[], viewingDayAvailabilities: AvailabilityEvent[]) => boolean | null; availByIndex: (days: Date[], avails: AvailabilityEvent[], excludeWeekends: boolean, excludeFn?: ((date: Date) => boolean) | undefined) => { hasAvail: boolean; }[]; addBlockOutBookings: (blockOutPeriods: MsSinceMidnightRange[], providerTimeZone: string, bookings: Booking[], localStart: Date, localEnd: Date) => Booking[]; availabilitiesFromBookings: (blockOutPeriods: MsSinceMidnightRange[], providerTimeZone: string, bookings: Booking[], now: Date, periodStartArg: Date, periodEnd: Date) => AvailabilityEvent[]; toStartAndEnd: (range: Range) => { startDate: Date; endDate: Date; }; monthRangeForDate: (d: Date) => { start: Date; end: Date; }; monthDaysForDate: (date: Date) => { weeks: Date[][]; days: Date[]; }; shouldIncludeDate: (d: Date, excludeWeekends: boolean, excludeFn?: ((date: Date) => boolean) | undefined) => boolean; chunkify: (intervals: AvailabilityEvent[], chunkLenMs: number, stepLenMs: number) => AvailabilityEvent[]; };