export function optionToDate(duration: { value: string }) { const option = duration.value ? duration.value : duration; const date = new Date(); if (option === '3 Days') return new Date(date.getTime() + 3 * 60 * 1000).toISOString(); if (option === '1 Week') return new Date(date.getFullYear(), date.getMonth(), date.getDate() + 7).toISOString(); if (option === '3 Week') return new Date(date.getFullYear(), date.getMonth(), date.getDate() + 21).toISOString(); if (option === '1 Month') return new Date(date.getFullYear(), date.getMonth() + 1, date.getDate()).toISOString(); if (option === '3 Month') return new Date(date.getFullYear(), date.getMonth() + 3, date.getDate()).toISOString(); else return date.toISOString(); }