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.
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
Parameter | Type | Description |
---|---|---|
options | Intl.DateTimeFormatOptions | DateTimeFormatOptions to format date |
locale | string | string[] | null | browser locale, or default |
fallback | string | default format if Intl API is not present |
Returns:
string