UNPKG

tempe

Version:

Featherlight (< 2kB) helper for simple javascript date formatting without all of those superpowers

17 lines (16 loc) 764 B
import { Locale, CalendarType } from './types'; declare class TempeDate { date: Date; constructor(dateObject: Date); /** * Format the inputted date object * @param stringFormat printed format such as DD MMM YYYY * @param locale locale code with BCP 47 standard language tag * @param calendarType the calendar types, usually affect the year. Possible input includes but not limited to "gregory", "buddhist", "islamic", "japanese" * @returns string */ format(stringFormat: string, locale?: Locale, calendarType?: CalendarType): string; mapAvailableStringFormatToValue(stringFormats: Array<string>, locale: Locale | string): any; } declare function init(...args: any): TempeDate; export default init;