UNPKG

@commercetools-uikit/calendar-utils

Version:

Utilities to work with values for a calendar.

28 lines (27 loc) 1.82 kB
import type { MomentInput, DurationInputArg1 } from 'moment'; export declare const getDaysInMonth: (day: MomentInput) => number; export declare const getDateInMonth: (day: MomentInput) => number; export declare const getToday: () => string; export declare const formatDate: (day: MomentInput, locale: string) => string; export declare const changeMonth: (day: MomentInput, delta: DurationInputArg1) => string; export declare const getNextDay: (day: MomentInput) => string; export declare const getPreviousDay: (day: MomentInput) => string; export declare const getPaddingDayCount: (day: MomentInput, locale: string) => number; export declare const getWeekdayNames: (locale: string) => string[]; export declare const getMonthCalendarLabel: (day: MomentInput, locale: string) => string; export declare const getYearCalendarLabel: (day: MomentInput, locale: string) => string; export declare const isSameDay: (a: MomentInput, b: MomentInput) => boolean; export declare const getCalendarDayLabel: (day: MomentInput) => string; export declare const isBetween: (item: MomentInput, start: MomentInput, end: MomentInput) => boolean; export declare const createCalendarItems: (day: MomentInput) => string[]; export declare const createItemRangeToString: (locale: string) => (item: MomentInput) => string; export declare const createItemToString: (locale: string) => (item: MomentInput) => string; export declare const formatRange: (range: MomentInput[], locale: string) => string; export declare const parseInputToDate: (text: MomentInput, locale: string) => string; export declare const getIsDateInRange: (item: MomentInput, min: MomentInput, max: MomentInput) => boolean; export declare const getExampleDateStrings: () => { currentDate: string; preselectedDate: string; minDate: string; maxDate: string; };