@procore/core-react
Version:
React library of Procore Design Guidelines
34 lines (33 loc) • 1.63 kB
TypeScript
import * as React from 'react';
export declare const dateTimeFormats: {
readonly 'abbr-weekday-abbr-date': "abbr-weekday-abbr-date";
readonly 'abbr-weekday-abbr-date-at-time': "abbr-weekday-abbr-date-at-time";
readonly date: "date";
readonly 'date-at-time': "date-at-time";
readonly 'numeric-date': "numeric-date";
readonly 'numeric-date-at-time': "numeric-date-at-time";
readonly time: "time";
readonly 'time-on-abbr-weekday-abbr-date': "time-on-abbr-weekday-abbr-date";
readonly 'time-on-weekday-date': "time-on-weekday-date";
readonly 'time-on-date': "time-on-date";
readonly 'time-on-numeric-date': "time-on-numeric-date";
readonly 'weekday-date': "weekday-date";
readonly 'weekday-date-at-time': "weekday-date-at-time";
readonly none: "none";
};
export declare type DateTimeFormatTypes = (typeof dateTimeFormats)[keyof typeof dateTimeFormats];
export declare type DateTimeContextConfig = Pick<Intl.DateTimeFormatOptions, 'hour12' | 'timeZone'>;
export declare type DateTimeProviderProps = {
children: React.ReactNode;
} & DateTimeContextConfig;
export declare function DateTimeProvider({ children, hour12, timeZone, }: DateTimeProviderProps): React.JSX.Element;
interface DateTimeAPI {
format: (value: Date, type: DateTimeFormatTypes, options?: Intl.DateTimeFormatOptions, timeOptions?: Intl.DateTimeFormatOptions,
/** @internal */
/** For internal development use, logging with env TZ_LOG. Unversioned API */
UNSAFE_log?: string) => string;
hour12?: boolean;
timeZone?: string;
}
export declare function useDateTime(): DateTimeAPI;
export {};