diff --git a/ts/features/wallet/bancomat/component/bancomatCard/BancomatCard.tsx b/ts/features/wallet/bancomat/component/bancomatCard/BancomatCard.tsx index 89cadd4bdc7..739e1c8f1fa 100644 --- a/ts/features/wallet/bancomat/component/bancomatCard/BancomatCard.tsx +++ b/ts/features/wallet/bancomat/component/bancomatCard/BancomatCard.tsx @@ -12,6 +12,18 @@ type Props = ReturnType & ReturnType & OwnProps; +const getExpireDate = (fullYear?: string, month?: string): Date | undefined => { + if (!fullYear || !month) { + return undefined; + } + const year = parseInt(fullYear, 10); + const indexedMonth = parseInt(month, 10); + if (isNaN(year) || isNaN(indexedMonth)) { + return undefined; + } + return new Date(year, indexedMonth - 1); +}; + /** * Render a bancomat already added to the wallet * @param props @@ -20,11 +32,10 @@ type Props = ReturnType & const BancomatCard: React.FunctionComponent = props => ( );