Menu

Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.

Enterprise Open source

localTimeFormat() function

localTimeFormat() function

localTimeFormat helps to generate date formats for momentjs based on browser’s locale

Signature

typescript
export declare function localTimeFormat(options: Intl.DateTimeFormatOptions, locale?: string | string[] | null, fallback?: string): string;

Import

typescript
import { localTimeFormat } from '@grafana/data';

Parameters

ParameterTypeDescription
optionsIntl.DateTimeFormatOptionsDateTimeFormatOptions to format date
localestring | string[] | nullbrowser locale, or default
fallbackstringdefault format if Intl API is not present

Returns:

string