Commit 43519199 authored by Igor Stuev's avatar Igor Stuev Committed by GitHub

Add time selector to the CSV export (#2764)

parent d0a80069
......@@ -32,8 +32,8 @@ const CsvExportForm = ({ hash, resource, filterType, filterValue, fileNameTempla
const formApi = useForm<FormFields>({
mode: 'onBlur',
defaultValues: {
from: dayjs().subtract(1, 'day').format('YYYY-MM-DD'),
to: dayjs().format('YYYY-MM-DD'),
from: dayjs().subtract(1, 'day').format('YYYY-MM-DDTHH:mm'),
to: dayjs().format('YYYY-MM-DDTHH:mm'),
},
});
const { handleSubmit, formState } = formApi;
......@@ -49,8 +49,8 @@ const CsvExportForm = ({ hash, resource, filterType, filterValue, fileNameTempla
const url = buildUrl(resource, { hash } as never, {
address_id: hash,
from_period: exportType !== 'holders' ? data.from : null,
to_period: exportType !== 'holders' ? data.to : null,
from_period: exportType !== 'holders' ? dayjs(data.from).toISOString() : null,
to_period: exportType !== 'holders' ? dayjs(data.to).toISOString() : null,
filter_type: filterType,
filter_value: filterValue,
recaptcha_response: token,
......
......@@ -38,7 +38,7 @@ const CsvExportFormField = ({ formApi, name }: Props) => {
return (
<FormFieldText<FormFields, typeof name>
name={ name }
inputProps={{ type: 'date', max: dayjs().format('YYYY-MM-DD') }}
inputProps={{ type: 'datetime-local', max: dayjs().format('YYYY-MM-DDTHH:mm') }}
placeholder={ capitalize(name) }
required
rules={{ validate }}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment