import { IFormatHandler, SpecParts } from "../Formatter"; /** * Error thrown for an invalid value passed to the date formatter. * * This may be due to a string that fails to parse, a non-Date object instance, * an Invalid Date instance, or not a Date or a string. * * @param message * @constructor */ export declare function BadDateValue(message: string): { name: string; message: string; stack?: string; cause?: unknown; }; /** * DateFormatter * * This is the _named handler_ for 'date' formatting. * This main class evaluates the passed value and discerns the desired Date object from this. * It then employs the internal `SimpleDateParser` to represent the date according to format. */ export default class DateFormatter implements IFormatHandler { format(specParts: SpecParts, value: any): string; } /** * This internal class is the workhorse of DateFormatter. It transforms a date format string into a correspondingly * formatted Date display utiliing the format components as decribed. Will utilize `Intl` where appropriate, if available. * * format notation: * YYYY = 4 digit year (e.g. 2020) * YYY = 4 digit year, but only show if not the current year * YY = 2 digit year (e.g. 20) * Y = 2 digit year only shown if not the current year * (if a year is not shown, characters in format beyond are skipped until the next parse token) * * MMMM = full name of month (e.g. 'February') * MMM = abbreviated name of month (3 letters, e.g. 'Feb') * MM = 2 digit month (leading 0) (e.g. 02) * M = 1-2 digit month (no leading 0) (e.g. 2) * * WWWW = Full weekday name (e.g. 'Saturday') * WWW = three letter weekday abbreviation (e.g. 'Sat') * WW = two letter weekday abbreviation (uncommon) (e.g. 'Mo', 'Sa') * W = 1 - 2 letter weekday abbreviation (e.g. 'M', 'Th') * * DD = 2 digit day, with leading 0 * D = 1 - 2 digit day, no leading 0 * * hhhh = 24 hour time, leading 0 * hhh = 24 hour time, no leading 0 * hh = 12 hour time, leading 0 * h = 12 hour time, no leading 0 * * mm = minutes with leading 0 * m = minutes without leading 0 * * ss = seconds with leading 0 * s = seconds witout leading 0 * * .sss = milliseconds (includes the .) * .ss` = 1/100th seconds (includes the .) * .s = 1/10th seconds (includes the .) * * ++ = AM/PM notation (upper case) * -- = am/pm (lower case) * -+ - PM only (upper case) * +- = PM only (lower case) * -? = a/p (lower case) * +? = A/P (upper case) * * x = milliseconds (as an integer without a period) * * j = javascript standard millisecond timestamp * u = unix standard second timestamp * * all other characters are kept in place for format display. Do not use format characters elsewhere. */ export declare class SimpleDateFormat { private format; private locale; private tzCast; private workingDate; private mo; private wd; private dy; private yr; private hr; private mn; private ss; private ms; private tz; private jts; private uts; constructor(dtIn: any); setWorkingDate(workingDate: any): void; setFormat(fmt: string): void; setLocale(locale?: string): void; setTimezoneCast(tzCast: string): void; toIntlString(): string; toString(): string; }