Comments (3)
The same problem with -
instead of /
.
So I tried to change test case:
public function it_checks_expiration_date()
{
// ...
$this->assertTrue($this->dateValidator('02-18', 'MM-YY')->passes());
// ...
}
And it fails :–(.
This 02-18
value and MM-YY
format are from examples in README.md, but this do not work.
from credit-card.
I found the source of my problems: there is incorrect format. The right one is Carbon::createFromFormat('m/y', '06/23')
. Need to fix it in README.md
and change MM-YY
format there.
I can fix readme. But what to do with Carbon::parse()
and its exception? What do you think?
from credit-card.
I just ran into this issue because I wanted to use the 'm/Y' format. The Carbon::parse() doesn't do anything helpful. I ended up having to abandon this validation for regex/date_format/after validations.
I think that line was added because it blocks a string like '3/22' without a leading zero because there is no way to enforce checking for the leading 0 with the date parsing in PHP. The only way I can thing to fix that is by doing a string comparison of the string to be parsed to the result formatted back. Unfortunately, then formats that you want to have match leading 0 not required but allowed wouldn't be reliable.
from credit-card.
Related Issues (20)
- How to customize validation message from Form Request ? HOT 2
- Added new cards HOT 1
- Problems validating the month
- Card Number Validator is not working
- Hipercard not work HOT 2
- how to customise validation message? HOT 4
- wrong rules for validation
- Laravel 6.0 HOT 3
- Add laravel 7 support HOT 1
- Custom message without translation HOT 2
- How to validate an flag?
- please add php 8 support HOT 2
- PHP8 support HOT 1
- ELO mais brand cvv invalid HOT 1
- There is no way to set message of new CardExpirationDate('m/y') class
- Custom Message HOT 2
- [Welling To Contribute] Laravel 10 support HOT 1
- JCB card is not validate HOT 7
- How can get card brand? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from credit-card.