@dnb/eufemia
Version:
DNB Eufemia Design System UI Library
33 lines (32 loc) • 1.28 kB
TypeScript
import type { ReactNode } from 'react';
import type { InternalLocale } from '../../shared/Context';
import type { SpacingProps } from '../../shared/types';
import type { SkeletonShow } from '../Skeleton';
type DateFormatProps = SpacingProps & {
value?: Date | string | number;
children?: ReactNode;
locale?: InternalLocale;
dateStyle?: Intl.DateTimeFormatOptions['dateStyle'];
timeStyle?: Intl.DateTimeFormatOptions['timeStyle'];
dateTimeSeparator?: string;
/**
* When `true`, the year is hidden if the date is in the current year, for any `dateStyle` (e.g. "4. feb." instead of "4. feb. 2025"). Defaults to `false`.
*/
hideCurrentYear?: boolean;
/**
* When `true`, the year is always hidden from the formatted date, for any `dateStyle`. Defaults to `false`.
*/
hideYear?: boolean;
relativeTimeStyle?: Intl.DateTimeFormatOptions['dateStyle'];
relativeTime?: boolean;
relativeTimeReference?: () => Date;
skeleton?: SkeletonShow;
className?: string;
id?: string;
title?: string;
'aria-label'?: string;
'aria-labelledby'?: string;
'aria-describedby'?: string;
};
declare function DateFormat(props: DateFormatProps): import("react/jsx-runtime").JSX.Element;
export default DateFormat;