UNPKG

@intility/bifrost-react

Version:

React library for Intility's design system, Bifrost.

22 lines (21 loc) 954 B
import { DateTimeFormatterOptions } from "../../hooks/useDateTimeFormatter.js"; export type FormatDateShow = Exclude<DateTimeFormatterOptions["show"], undefined>; export type FormatDateProps = DateTimeFormatterOptions & { /** Always show full time and date in tooltip regardless of `show` option */ fullTooltip?: boolean; /** Bool to not show tooltip */ noTooltip?: boolean; }; /** * Format date and/or time based on current Bifrost locale. Includes a * tooltip to avoid day vs month and timezone confusion. * * @see https://bifrost.intility.com/react/formatDate * * @example * <FormatDate date={new Date()} /> // 27/08/2025 * <FormatDate show="time" date={new Date()} /> // 15:17 * <FormatDate show="datetime" date={new Date()} /> // 27/08/2025 15:17 */ declare const FormatDate: ({ date, show, options, locale, fullTooltip, noTooltip, }: FormatDateProps) => import("react/jsx-runtime").JSX.Element; export default FormatDate;