refactor(api): trim timeline allocation date support
This commit is contained in:
@@ -11,23 +11,6 @@ export function assertTimelineDateRangeValid(startDate: Date, endDate: Date): vo
|
||||
});
|
||||
}
|
||||
|
||||
export function buildTimelineAllocationMetadata(input: {
|
||||
existingMetadata: Record<string, unknown> | null | undefined;
|
||||
includeSaturday: boolean | undefined;
|
||||
}): { metadata: Record<string, unknown>; includeSaturday: boolean } {
|
||||
const existingMetadata = input.existingMetadata ?? {};
|
||||
const metadata: Record<string, unknown> = {
|
||||
...existingMetadata,
|
||||
...(input.includeSaturday !== undefined
|
||||
? { includeSaturday: input.includeSaturday }
|
||||
: {}),
|
||||
};
|
||||
const includeSaturday =
|
||||
input.includeSaturday ?? (existingMetadata.includeSaturday as boolean | undefined) ?? false;
|
||||
|
||||
return { metadata, includeSaturday };
|
||||
}
|
||||
|
||||
export function validateTimelineAllocationDateRanges(
|
||||
ranges: Array<{ startDate: Date; endDate: Date }>,
|
||||
): void {
|
||||
|
||||
Reference in New Issue
Block a user