288 lines
7.3 KiB
Markdown
288 lines
7.3 KiB
Markdown
|
## API Report File for "@fluentui/date-time-utilities"
|
||
|
|
||
|
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
||
|
|
||
|
```ts
|
||
|
|
||
|
// @public
|
||
|
export function addDays(date: Date, days: number): Date;
|
||
|
|
||
|
// @public
|
||
|
export const addMinutes: (date: Date, minutes: number) => Date;
|
||
|
|
||
|
// @public
|
||
|
export function addMonths(date: Date, months: number): Date;
|
||
|
|
||
|
// @public
|
||
|
export function addWeeks(date: Date, weeks: number): Date;
|
||
|
|
||
|
// @public
|
||
|
export function addYears(date: Date, years: number): Date;
|
||
|
|
||
|
// @public
|
||
|
export const ceilMinuteToIncrement: (date: Date, increments: number) => Date;
|
||
|
|
||
|
// @public
|
||
|
export function compareDatePart(date1: Date, date2: Date): number;
|
||
|
|
||
|
// @public
|
||
|
export function compareDates(date1: Date, date2: Date): boolean;
|
||
|
|
||
|
// @public
|
||
|
export enum DateRangeType {
|
||
|
// (undocumented)
|
||
|
Day = 0,
|
||
|
// (undocumented)
|
||
|
Month = 2,
|
||
|
// (undocumented)
|
||
|
Week = 1,
|
||
|
// (undocumented)
|
||
|
WorkWeek = 3
|
||
|
}
|
||
|
|
||
|
// @public
|
||
|
export enum DayOfWeek {
|
||
|
// (undocumented)
|
||
|
Friday = 5,
|
||
|
// (undocumented)
|
||
|
Monday = 1,
|
||
|
// (undocumented)
|
||
|
Saturday = 6,
|
||
|
// (undocumented)
|
||
|
Sunday = 0,
|
||
|
// (undocumented)
|
||
|
Thursday = 4,
|
||
|
// (undocumented)
|
||
|
Tuesday = 2,
|
||
|
// (undocumented)
|
||
|
Wednesday = 3
|
||
|
}
|
||
|
|
||
|
// @public (undocumented)
|
||
|
export const DAYS_IN_WEEK = 7;
|
||
|
|
||
|
// @public (undocumented)
|
||
|
export const DEFAULT_CALENDAR_STRINGS: ICalendarStrings;
|
||
|
|
||
|
// @public (undocumented)
|
||
|
export const DEFAULT_DATE_FORMATTING: IDateFormatting;
|
||
|
|
||
|
// @public (undocumented)
|
||
|
export const DEFAULT_DATE_GRID_STRINGS: IDateGridStrings;
|
||
|
|
||
|
// @public
|
||
|
export const findAvailableDate: (options: IAvailableDateOptions) => Date | undefined;
|
||
|
|
||
|
// @public
|
||
|
export enum FirstWeekOfYear {
|
||
|
// (undocumented)
|
||
|
FirstDay = 0,
|
||
|
// (undocumented)
|
||
|
FirstFourDayWeek = 2,
|
||
|
// (undocumented)
|
||
|
FirstFullWeek = 1
|
||
|
}
|
||
|
|
||
|
// @public
|
||
|
export const formatDay: (date: Date) => string;
|
||
|
|
||
|
// @public
|
||
|
export const formatMonth: (date: Date, strings: IDateGridStrings) => string;
|
||
|
|
||
|
// @public
|
||
|
export const formatMonthDayYear: (date: Date, strings: IDateGridStrings) => string;
|
||
|
|
||
|
// @public
|
||
|
export const formatMonthYear: (date: Date, strings: IDateGridStrings) => string;
|
||
|
|
||
|
// @public
|
||
|
export const formatTimeString: (date: Date, showSeconds?: boolean, useHour12?: boolean) => string;
|
||
|
|
||
|
// @public
|
||
|
export const formatYear: (date: Date) => string;
|
||
|
|
||
|
// @public
|
||
|
export const getBoundedDateRange: (dateRange: Date[], minDate?: Date, maxDate?: Date) => Date[];
|
||
|
|
||
|
// @public
|
||
|
export const getDateFromTimeSelection: (useHour12: boolean, dateStartAnchor: Date, selectedTime: string) => Date;
|
||
|
|
||
|
// @public
|
||
|
export function getDatePartHashValue(date: Date): number;
|
||
|
|
||
|
// @public
|
||
|
export function getDateRangeArray(date: Date, dateRangeType: DateRangeType, firstDayOfWeek: DayOfWeek, workWeekDays?: DayOfWeek[], daysToSelectInDayView?: number): Date[];
|
||
|
|
||
|
// @public
|
||
|
export const getDateRangeTypeToUse: (dateRangeType: DateRangeType, workWeekDays: DayOfWeek[] | undefined, firstDayOfWeek: DayOfWeek) => DateRangeType;
|
||
|
|
||
|
// @public
|
||
|
export const getDayGrid: (options: IDayGridOptions) => IDay[][];
|
||
|
|
||
|
// @public
|
||
|
export function getEndDateOfWeek(date: Date, firstDayOfWeek: DayOfWeek): Date;
|
||
|
|
||
|
// @public
|
||
|
export function getMonthEnd(date: Date): Date;
|
||
|
|
||
|
// @public
|
||
|
export function getMonthStart(date: Date): Date;
|
||
|
|
||
|
// @public
|
||
|
export function getStartDateOfWeek(date: Date, firstDayOfWeek: DayOfWeek): Date;
|
||
|
|
||
|
// @public
|
||
|
export function getWeekNumber(date: Date, firstDayOfWeek: DayOfWeek, firstWeekOfYear: FirstWeekOfYear): number;
|
||
|
|
||
|
// @public
|
||
|
export function getWeekNumbersInMonth(weeksInMonth: number, firstDayOfWeek: DayOfWeek, firstWeekOfYear: FirstWeekOfYear, navigatedDate: Date): number[];
|
||
|
|
||
|
// @public
|
||
|
export function getYearEnd(date: Date): Date;
|
||
|
|
||
|
// @public
|
||
|
export function getYearStart(date: Date): Date;
|
||
|
|
||
|
// @public (undocumented)
|
||
|
export interface IAvailableDateOptions extends IRestrictedDatesOptions {
|
||
|
direction: number;
|
||
|
initialDate: Date;
|
||
|
targetDate: Date;
|
||
|
}
|
||
|
|
||
|
// @public (undocumented)
|
||
|
export interface ICalendarStrings extends IDateGridStrings {
|
||
|
closeButtonAriaLabel?: string;
|
||
|
dayMarkedAriaLabel?: string;
|
||
|
goToToday: string;
|
||
|
monthPickerHeaderAriaLabel?: string;
|
||
|
nextMonthAriaLabel?: string;
|
||
|
nextYearAriaLabel?: string;
|
||
|
nextYearRangeAriaLabel?: string;
|
||
|
prevMonthAriaLabel?: string;
|
||
|
prevYearAriaLabel?: string;
|
||
|
prevYearRangeAriaLabel?: string;
|
||
|
selectedDateFormatString?: string;
|
||
|
todayDateFormatString?: string;
|
||
|
weekNumberFormatString?: string;
|
||
|
yearPickerHeaderAriaLabel?: string;
|
||
|
}
|
||
|
|
||
|
// @public (undocumented)
|
||
|
export interface IDateFormatting {
|
||
|
formatDay: (date: Date) => string;
|
||
|
formatMonth: (date: Date, strings: IDateGridStrings) => string;
|
||
|
formatMonthDayYear: (date: Date, strings: IDateGridStrings) => string;
|
||
|
formatMonthYear: (date: Date, strings: IDateGridStrings) => string;
|
||
|
formatYear: (date: Date) => string;
|
||
|
}
|
||
|
|
||
|
// @public (undocumented)
|
||
|
export interface IDateGridStrings {
|
||
|
days: string[];
|
||
|
months: string[];
|
||
|
shortDays: string[];
|
||
|
shortMonths: string[];
|
||
|
}
|
||
|
|
||
|
// @public (undocumented)
|
||
|
export interface IDay {
|
||
|
date: string;
|
||
|
isInBounds: boolean;
|
||
|
isInMonth: boolean;
|
||
|
isMarked: boolean;
|
||
|
isSelected: boolean;
|
||
|
isToday: boolean;
|
||
|
key: string;
|
||
|
originalDate: Date;
|
||
|
}
|
||
|
|
||
|
// @public (undocumented)
|
||
|
export interface IDayGridOptions extends IRestrictedDatesOptions {
|
||
|
dateRangeType: DateRangeType;
|
||
|
daysToSelectInDayView?: number;
|
||
|
firstDayOfWeek: DayOfWeek;
|
||
|
firstWeekOfYear: FirstWeekOfYear;
|
||
|
markedDays?: Date[];
|
||
|
navigatedDate: Date;
|
||
|
selectedDate: Date;
|
||
|
showWeekNumbers?: boolean;
|
||
|
today?: Date;
|
||
|
weeksToShow?: number;
|
||
|
workWeekDays?: DayOfWeek[];
|
||
|
}
|
||
|
|
||
|
// @public (undocumented)
|
||
|
export interface IRestrictedDatesOptions {
|
||
|
maxDate?: Date;
|
||
|
minDate?: Date;
|
||
|
restrictedDates?: Date[];
|
||
|
}
|
||
|
|
||
|
// @public
|
||
|
export const isAfterMaxDate: (date: Date, options: IRestrictedDatesOptions) => boolean;
|
||
|
|
||
|
// @public
|
||
|
export const isBeforeMinDate: (date: Date, options: IRestrictedDatesOptions) => boolean;
|
||
|
|
||
|
// @public
|
||
|
export const isContiguous: (days: DayOfWeek[], isSingleWeek: boolean, firstDayOfWeek: DayOfWeek) => boolean;
|
||
|
|
||
|
// @public
|
||
|
export function isInDateRangeArray(date: Date, dateRange: Date[]): boolean;
|
||
|
|
||
|
// @public
|
||
|
export const isRestrictedDate: (date: Date, options: IRestrictedDatesOptions) => boolean;
|
||
|
|
||
|
// @public
|
||
|
export enum MonthOfYear {
|
||
|
// (undocumented)
|
||
|
April = 3,
|
||
|
// (undocumented)
|
||
|
August = 7,
|
||
|
// (undocumented)
|
||
|
December = 11,
|
||
|
// (undocumented)
|
||
|
February = 1,
|
||
|
// (undocumented)
|
||
|
January = 0,
|
||
|
// (undocumented)
|
||
|
July = 6,
|
||
|
// (undocumented)
|
||
|
June = 5,
|
||
|
// (undocumented)
|
||
|
March = 2,
|
||
|
// (undocumented)
|
||
|
May = 4,
|
||
|
// (undocumented)
|
||
|
November = 10,
|
||
|
// (undocumented)
|
||
|
October = 9,
|
||
|
// (undocumented)
|
||
|
September = 8
|
||
|
}
|
||
|
|
||
|
// @public
|
||
|
export function setMonth(date: Date, month: number): Date;
|
||
|
|
||
|
// @public (undocumented)
|
||
|
export const TimeConstants: {
|
||
|
MillisecondsInOneDay: number;
|
||
|
MillisecondsIn1Sec: number;
|
||
|
MillisecondsIn1Min: number;
|
||
|
MillisecondsIn30Mins: number;
|
||
|
MillisecondsIn1Hour: number;
|
||
|
MinutesInOneDay: number;
|
||
|
MinutesInOneHour: number;
|
||
|
DaysInOneWeek: number;
|
||
|
MonthInOneYear: number;
|
||
|
HoursInOneDay: number;
|
||
|
SecondsInOneMinute: number;
|
||
|
OffsetTo24HourFormat: number;
|
||
|
TimeFormatRegex: RegExp;
|
||
|
};
|
||
|
|
||
|
// (No @packageDocumentation comment for this package)
|
||
|
|
||
|
```
|