@ministryofjustice/hmpps-digital-prison-reporting-frontend
Version:
The Digital Prison Reporting Frontend contains templates and code to help display data effectively in UI applications.
23 lines (22 loc) • 731 B
TypeScript
import dayjs from 'dayjs';
import RelativeDateRange from '../components/_inputs/date-range/types';
/**
* Internal date range representation (neutral, unformatted)
*/
export type CalculatedDateRange = {
startDate: dayjs.Dayjs;
endDate: dayjs.Dayjs;
};
export type CalculableRelativeDateRange = Exclude<RelativeDateRange, RelativeDateRange.NONE>;
export declare const calcDates: (range: RelativeDateRange) => CalculatedDateRange | null;
export declare const calcDatesForUI: (range: RelativeDateRange) => {
start: string;
end: string;
} | null;
/**
* Adapter for filter definitions (YYYY-MM-DD)
*/
export declare const calcDatesForAPI: (range: RelativeDateRange) => {
start: string;
end: string;
} | null;