@commercetools-uikit/calendar-time-utils
Version:
Utilities to work with time values for a calendar.
31 lines (30 loc) • 2.27 kB
TypeScript
import { DurationInputArg1, MomentInput, LocaleSpecifier } from 'moment-timezone';
type ParsedTime = {
hours: number;
minutes: number;
seconds: number;
milliseconds: number;
};
export declare const getDaysInMonth: (day: MomentInput, timeZone: string) => number;
export declare const changeDateInMonth: (day: MomentInput, timeZone: string, dayOfMonth: number) => string;
export declare const changeTime: (dateString: string, timeZone: string, parsedTime: ParsedTime) => string;
export declare const getPreviousDay: (day: MomentInput) => string;
export declare const formatDefaultTime: (time: string, locale: LocaleSpecifier) => string;
export declare const formatTime: (day: MomentInput, locale: LocaleSpecifier, timeZone: string) => string;
export declare const formatDate: (day: MomentInput, locale: string, timeZone: string) => string;
export declare const getDateInMonth: (day: MomentInput, timeZone: string) => number;
export declare const getToday: (timeZone: string) => string;
export declare const changeMonth: (day: MomentInput, timeZone: string, delta: DurationInputArg1) => string;
export declare const getPaddingDayCount: (day: MomentInput, locale: string, timeZone: string) => number;
export declare const getWeekdayNames: (locale: string) => string[];
export declare const getStartOf: (day: MomentInput, timeZone: 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, timeZone: string) => string;
export declare const createItemDateTimeToString: (locale: string, timeZone: string) => (item: string | null) => string;
export declare const createCalendarItems: (day: MomentInput, timeString: string, timeZone: string) => string[];
export declare const createSuggestedItems: (inputValue: string, timeZone: string) => string[];
export declare const parseInputText: (text: string, locale: string, timeZone: string) => string;
export declare const getLocalizedDateTimeFormatPattern: (locale: string, formatType?: "date" | "time" | "full") => string;
export {};