UNPKG

@js-sugar/date

Version:

A multi-calendar, tree-shakable, extensible, immutable and lightweight date library for JavaScript

30 lines (29 loc) 735 B
/** * @category Plugins */ import { DateTime } from '../main'; /** * Predefined formats * @public * @enum */ export declare enum Formats { /** ISO 8601 date time format */ iso = "YYYY-MM-ddTHH:mm:ss.fffzz", /** ISO 8601 date format */ isoDate = "YYYY-MM-dd" } /** * Format plugin options */ export interface FormatOptions { shortMonthNameMaxLength?: number; longMonthNameMaxLength?: number; } /** * Returns a string representation of this DateTime formatted according to the specified format string. * @param date DateTime * @param formatStr Format string * @public */ export declare function format(date: DateTime, formatStr: string, options?: FormatOptions): string;