Skip to content

Commit ae6d943

Browse files
committed
Add time selector to the CSV export
1 parent 3e88991 commit ae6d943

5 files changed

+5
-5
lines changed

ui/csvExport/CsvExportForm.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ const CsvExportForm = ({ hash, resource, filterType, filterValue, fileNameTempla
3232
const formApi = useForm<FormFields>({
3333
mode: 'onBlur',
3434
defaultValues: {
35-
from: dayjs().subtract(1, 'day').format('YYYY-MM-DD'),
36-
to: dayjs().format('YYYY-MM-DD'),
35+
from: dayjs().subtract(1, 'day').format('YYYY-MM-DDTHH:mm'),
36+
to: dayjs().format('YYYY-MM-DDTHH:mm'),
3737
},
3838
});
3939
const { handleSubmit, formState } = formApi;
@@ -49,8 +49,8 @@ const CsvExportForm = ({ hash, resource, filterType, filterValue, fileNameTempla
4949

5050
const url = buildUrl(resource, { hash } as never, {
5151
address_id: hash,
52-
from_period: exportType !== 'holders' ? data.from : null,
53-
to_period: exportType !== 'holders' ? data.to : null,
52+
from_period: exportType !== 'holders' ? dayjs(data.from).toISOString() : null,
53+
to_period: exportType !== 'holders' ? dayjs(data.to).toISOString() : null,
5454
filter_type: filterType,
5555
filter_value: filterValue,
5656
recaptcha_response: token,

ui/csvExport/CsvExportFormField.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const CsvExportFormField = ({ formApi, name }: Props) => {
3838
return (
3939
<FormFieldText<FormFields, typeof name>
4040
name={ name }
41-
inputProps={{ type: 'date', max: dayjs().format('YYYY-MM-DD') }}
41+
inputProps={{ type: 'datetime-local', max: dayjs().format('YYYY-MM-DDTHH:mm') }}
4242
placeholder={ capitalize(name) }
4343
required
4444
rules={{ validate }}
Loading
Loading
Loading

0 commit comments

Comments
 (0)