Add date picker bounds

pull/170/head
artemkolodko 3 years ago
parent e21175729f
commit b0e63543e9
  1. 2
      src/pages/ExportData/export-utils.ts
  2. 5
      src/pages/ExportData/index.tsx

@ -18,7 +18,7 @@ const mapRelatedTxToExport = (ownerAddress: string, tx: RelatedTransaction, oneP
const convertValue = (value: string | number, n = 4) => { const convertValue = (value: string | number, n = 4) => {
const precision = 18 const precision = 18
const bigIntValue = BigInt(value) / BigInt(10 ** (precision - n)) const bigIntValue = BigInt(parseInt(value.toString())) / BigInt(10 ** (precision - n))
return parseInt(bigIntValue.toString()) / (10 ** n); return parseInt(bigIntValue.toString()) / (10 ** n);
} }

@ -48,7 +48,10 @@ export const ExportData = () => {
const dateInputProps = { const dateInputProps = {
format: 'mm/dd/yyyy', format: 'mm/dd/yyyy',
value: (new Date()).toISOString(), value: (new Date()).toISOString(),
calendarProps: { size: 'medium' }, calendarProps: {
size: 'medium',
bounds: [dayjs().subtract(5, 'year').format(dateFormat), dayjs().format(dateFormat)]
},
inputProps: { width: '170px' } inputProps: { width: '170px' }
} }

Loading…
Cancel
Save