Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Fix isCreditCardExpirationDateValid logic #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

imajindev
Copy link

properly check for the year and month if the credit card expiry number:

  1. valid value
  2. not yet expired

@imajindev
Copy link
Author

#6

@imajindev
Copy link
Author

@PatrickBenz09 what you think of this update?

@imajindev
Copy link
Author

is this library no longer supported?

const expYear = Number(cardExpirationYear);
return (
expYear >= currentYear &&
expYear <= 2100 &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@imajindev could you mind changing into something like this

Suggested change
expYear <= 2100 &&
expYear <= currentYear + 100

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants