UNPKG

@carbon/utilities

Version:

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

31 lines (30 loc) 1.31 kB
/** * 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. */ export declare function formatTime(date: Date | number, options?: Partial<{ locale: string; style: Intl.DateTimeFormatOptions['timeStyle']; timeZone: Intl.DateTimeFormatOptions['timeZone']; }>): string; export declare function formatDate(date: Date | number, options?: Partial<{ locale: string; style: Intl.DateTimeFormatOptions['dateStyle']; timeZone: Intl.DateTimeFormatOptions['timeZone']; }>): string; export 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; export 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;