UNPKG

@carbon/utilities

Version:

Utilities and helpers to drive consistency across software products using the Carbon Design System

54 lines 1.95 kB
declare namespace relative_d_exports { export { format$1 as format }; } /** * Copyright IBM Corp. 2024 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ declare function format$1(date: Date | number, options?: Partial<{ locale: string; style: Intl.RelativeTimeFormatStyle; }>): string; declare namespace absolute_d_exports { export { format, formatDate, formatRange, formatTime }; } /** * Copyright IBM Corp. 2024, 2025 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ declare function formatTime(date: Date | number, options?: Partial<{ locale: string; style: Intl.DateTimeFormatOptions['timeStyle']; timeZone: Intl.DateTimeFormatOptions['timeZone']; }>): string; declare function formatDate(date: Date | number, options?: Partial<{ locale: string; style: Intl.DateTimeFormatOptions['dateStyle']; timeZone: Intl.DateTimeFormatOptions['timeZone']; }>): string; declare function format(date: Date | number, options?: Partial<{ locale: string; style: Intl.DateTimeFormatOptions['timeStyle'] | 'tooltip'; timeStyle: Intl.DateTimeFormatOptions['timeStyle']; dateStyle: Intl.DateTimeFormatOptions['dateStyle']; timeZone: Intl.DateTimeFormatOptions['timeZone']; }>): string; declare function formatRange(startDate: Date | number, endDate: Date | number, options?: Partial<{ locale: string; style: Intl.DateTimeFormatOptions['timeStyle']; timeStyle: Intl.DateTimeFormatOptions['timeStyle'] | null; dateStyle: Intl.DateTimeFormatOptions['dateStyle'] | null; timeZone: Intl.DateTimeFormatOptions['timeZone']; }>): string; //#endregion //#region src/dateTimeFormat/index.d.ts declare const dateTimeFormat: { relative: typeof relative_d_exports; absolute: typeof absolute_d_exports; }; //#endregion export { dateTimeFormat as t };