UNPKG

737 BTypeScriptView Raw
1import { LocalDate, LocalDateTime, LocalTime, ZonedDateTime, ZoneId } from '@js-joda/core';
2import '@js-joda/timezone';
3import { ILocalDateLike } from './conversion';
4export declare enum FormatDateType {
5 short = "short",
6 medium = "medium",
7 long = "long"
8}
9export interface FormatDateParams {
10 type?: FormatDateType | 'short' | 'medium' | 'long';
11 time?: boolean;
12 date?: boolean;
13 format?: string;
14}
15/**
16 * Formats a date to a string
17 * @param obj
18 * @param params
19 * @param zone
20 */
21export declare function formatDate(obj: ILocalDateLike | Date | LocalDate | number | string | LocalDateTime | LocalTime | ZonedDateTime | null | undefined, { type, time, date, format }?: FormatDateParams, zone?: ZoneId): string;