API Reference@grafana/datalocalTimeFormat

localTimeFormat() function

localTimeFormat() function

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

Signature

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

Import

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