fix: date parsing
This commit is contained in:
parent
e44e5012f1
commit
0d88e6eba2
1 changed files with 3 additions and 4 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
import { useLazyQuery, useMutation } from '@apollo/react-hooks'
|
import { useLazyQuery, useMutation } from '@apollo/react-hooks'
|
||||||
import { makeStyles, Box } from '@material-ui/core'
|
import { makeStyles, Box } from '@material-ui/core'
|
||||||
import BigNumber from 'bignumber.js'
|
import BigNumber from 'bignumber.js'
|
||||||
import { add, differenceInYears, format, sub } from 'date-fns/fp'
|
import { add, differenceInYears, format, sub, parse } from 'date-fns/fp'
|
||||||
import FileSaver from 'file-saver'
|
import FileSaver from 'file-saver'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import JSZip from 'jszip'
|
import JSZip from 'jszip'
|
||||||
|
|
@ -123,9 +123,8 @@ const DetailsRow = ({ it: tx, timezone }) => {
|
||||||
age: differenceInYears(tx.customerIdCardData.dateOfBirth, new Date()),
|
age: differenceInYears(tx.customerIdCardData.dateOfBirth, new Date()),
|
||||||
country: tx.customerIdCardData.country,
|
country: tx.customerIdCardData.country,
|
||||||
idCardNumber: tx.customerIdCardData.documentNumber,
|
idCardNumber: tx.customerIdCardData.documentNumber,
|
||||||
idCardExpirationDate: format(
|
idCardExpirationDate: format('yyyy-MM-dd')(
|
||||||
'dd-MM-yyyy',
|
parse(new Date(), 'yyyyMMdd', tx.customerIdCardData.expirationDate)
|
||||||
tx.customerIdCardData.expirationDate
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue