maz-ui
Version:
A standalone components library for Vue.Js 3 & Nuxt.Js 3
62 lines (61 loc) • 3.01 kB
TypeScript
import { MazUiTranslationsNestedSchema } from '@maz-ui/translations';
import { ConfigType, OpUnitType } from 'dayjs';
import { MazDatePickerPartialRangeValue, MazDatePickerValue } from './types';
export type DateTimeFormatOptions = Pick<Intl.DateTimeFormatOptions, 'hour12' | 'dateStyle' | 'timeStyle' | 'timeZone'>;
export declare function getFormattedDate({ value, locale, options, }: {
value?: string;
locale: string;
options?: Intl.DateTimeFormatOptions;
}): string | undefined;
export declare function getRangeFormattedDate({ value, locale, options, }: {
value: MazDatePickerPartialRangeValue;
locale: string;
options: Intl.DateTimeFormatOptions;
}): string | undefined;
export declare function getFirstDayOfMonth(value: ConfigType): number;
export declare function getDaysOfWeek(locale: string, firstDayOfWeek: number): string[];
export declare function getDaysInMonth(date: ConfigType): number;
export declare function isToday(date: ConfigType): boolean;
export declare function isSameDate(date: ConfigType, date2: ConfigType, unit: OpUnitType): boolean;
export declare function isSmaller(date: ConfigType, date2: ConfigType): boolean;
export declare function isSameDay(date: ConfigType, dayNumber: number): boolean;
export declare function getISODate(value?: ConfigType, format?: string): string | undefined;
export declare function getRangeISODate(value?: MazDatePickerPartialRangeValue, format?: string): {
start: string | undefined;
end: string | undefined;
} | undefined;
interface CheckValueResponse {
newValue?: string;
newCurrentDate?: string;
}
export declare function checkValueWithMinMaxDates({ value, minDate, maxDate, format, minMaxAuto, }: {
value: string | undefined;
minDate: string | undefined;
maxDate: string | undefined;
format: string;
minMaxAuto: boolean;
}): CheckValueResponse;
export declare function isValueDisabledWeekly({ value, disabledWeekly, }: {
value: string;
disabledWeekly: number[];
}): boolean;
export declare function isValueDisabledDate({ value, disabledDates, }: {
value: string;
disabledDates: string[];
}): boolean;
export declare function scrollToTarget(scrollContainer: HTMLElement, target: HTMLElement, offset?: number, hasSmoothEffect?: boolean): void;
export declare function findNearestNumberInList(list: number[], number: number): number;
export declare function convertHour24to12Format(baseHour: number): number;
export declare function convertHour12to24Format(baseHour: number): number;
export declare function convert12To24TimeFormat(timeStr: string): string;
export declare function isRangeValue(value: MazDatePickerValue): value is MazDatePickerPartialRangeValue;
export declare function isValidDate(value: unknown): value is ConfigType;
export declare function getDefaultsShortcuts(t: MazUiTranslationsNestedSchema['datePicker']['shortcuts']): {
label: string;
identifier: string;
value: {
start: string;
end: string;
};
}[];
export {};