mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
Add time selector to the CSV export (#2764)
This commit is contained in:
@@ -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 }}
|
||||
|
||||
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 20 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 34 KiB |
Reference in New Issue
Block a user