import { CoreDateObject } from '@sky-distribution/policy-service-interfaces/lib/core/SubmissionForm.type'; export const buildDatePartial = ( date?: string | number | Date, ): CoreDateObject | undefined => { if (!date) { return undefined; } const dateObj = new Date(String(date)); return { year: dateObj.getFullYear(), month: dateObj.getMonth(), day: dateObj.getDate(), }; };