Skip to content

Commit d28d384

Browse files
committed
feat: Update defaultv from/to date in export modal to be normalized
1 parent 0263677 commit d28d384

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/shared/features/AppletSettings/ExportDataSetting/ExportDataSetting.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { yupResolver } from '@hookform/resolvers/yup';
2+
import { endOfDay, startOfDay } from 'date-fns';
23
import { useCallback, useEffect, useMemo, useState } from 'react';
34
import { FormProvider, useForm } from 'react-hook-form';
45
import { ObjectSchema } from 'yup';
@@ -46,8 +47,8 @@ export const ExportDataSetting = ({
4647
? ExportDataExported.ResponsesAndEhrData
4748
: ExportDataExported.ResponsesOnly,
4849
dateType: ExportDateType.AllTime,
49-
fromDate: minDate,
50-
toDate: maxDate,
50+
fromDate: startOfDay(minDate),
51+
toDate: endOfDay(maxDate),
5152
supplementaryFiles: SupplementaryFiles.reduce(
5253
(acc, fileType) => ({ ...acc, [fileType]: false }),
5354
{} as Record<SupplementaryFiles, boolean>,

0 commit comments

Comments
 (0)