@ministryofjustice/hmpps-digital-prison-reporting-frontend
Version:
The Digital Prison Reporting Frontend contains templates and code to help display data effectively in UI applications.
27 lines (26 loc) • 980 B
TypeScript
import dayjs, { Dayjs } from 'dayjs';
import { DateType } from './types';
declare class DateMapper {
private isoDateRegEx;
private localDateRegEx;
private localDateShortYearRegEx;
private localDateTimeRegEx;
private localDateTimeShortYearRegEx;
private isoFormat;
private localDateFormatInput;
private localDateFormatOutput;
private localDateShortYearFormatInput;
private localDateShortYearFormatOutput;
private localDateTimeFormatInput;
private localDateTimeFormatOutput;
private localDateTimeShortYearFormatInput;
private localDateTimeShortYearFormatOutput;
getDateType(value: string | null): DateType;
getDateWrapper(value: string | null): Dayjs | null;
getFormats: () => string[];
isDate(value: string | null): boolean;
parseIfDate: (value: string) => dayjs.Dayjs | null;
toDateString(value: string | null, type: DateType): string | undefined;
}
export { DateMapper };
export default DateMapper;