@jupyterlab/coreutils
Version:
JupyterLab - Core Utilities
23 lines (22 loc) • 650 B
TypeScript
/**
* The namespace for date functions.
*/
export declare namespace Time {
type HumanStyle = 'long' | 'short' | 'narrow';
/**
* Convert a timestring to a human readable string (e.g. 'two minutes ago').
*
* @param value - The date timestring or date object.
*
* @returns A formatted date.
*/
function formatHuman(value: string | Date, format?: HumanStyle): string;
/**
* Convenient helper to convert a timestring to a date format.
*
* @param value - The date timestring or date object.
*
* @returns A formatted date.
*/
function format(value: string | Date): string;
}