UNPKG

@tiller-ds/date

Version:

Date module of Tiller Design System

22 lines (21 loc) 894 B
/// <reference types="react" /> export declare type DateProps = { /** * Data handed to the component in a valid date format. * * If using the component **with** IntlProvider you don't need to pass the _format_ prop, the * format will be inferred from the locale. * * If using the component **without** IntlProvider, you must also pass the _format_ prop. * * Other props come from Intl.DateTimeFormatOptions (https://bit.ly/3urm8s5) */ children: Date; /** * Format of formatted date (e.g. 'dd. MM. yyyy.' or 'MM/dd/yyyy'). * * If used, the component will format the date in this format, regardless of the locale inferred from IntlProvider (if it exists). */ format?: string; } & Intl.DateTimeFormatOptions; export default function Date({ children, format, ...props }: DateProps): JSX.Element;