reablocks
Version:
Component library for React
47 lines (45 loc) • 1.08 kB
TypeScript
import { DateFormatTheme } from './DateFormatTheme';
import { FC } from 'react';
export interface DateFormatProps {
/**
* Allow the user to toggle between relative and absolute time.
*/
allowToggle?: boolean;
/**
* The cache key to use for storing the user's preference.
*/
cacheKey?: string;
/**
* The date to format.
*/
date?: Date | null | number | string;
/**
* The format to use.
*/
format?: string;
/**
* Whether to use relative time.
*/
fromNow?: boolean;
/**
* Whether to add a suffix to the relative time.
*/
addSuffix?: boolean;
/**
* Additional CSS class names to use.
*/
className?: string;
/**
* Whether to include seconds in the relative time.
*/
includeSeconds?: boolean;
/**
* The message to display when the date is empty. Default is "N/A".
*/
emptyMessage?: string;
/**
* Theme for the DateFormat.
*/
theme?: DateFormatTheme;
}
export declare const DateFormat: FC<DateFormatProps>;