Hacker News new | ask | show | jobs
by sethist 4883 days ago
I was referring to the live demo at http://stripe.github.com/jquery.payment/example/. Either way, I wouldn't consider the library interpreting 113 as 11/3 as a "working".
1 comments

So what do you suggest "113" should be interpreted as?
There are three ways to interpret it. It is either 11/3, 1/13, or an error. Since 11/3 isn't a valid date, I think it is safe to rule that out as an incorrect interpretation. Either of the other two interpretations seem acceptable to me.
Er, since when is 11/3 not a valid date?
Not for a credit card expiration date...
How would you type in 11/30 if it blurts out a big error the moment you type 113?
The same way the system allows you to type in 0213 without blurting out a big error the moment you type 02. Just don't validate the input while the user is still inputting it.

Secondly, remember this is for credit card expirations and not normal dates. You can probably make an assumption that 11/30 (November 2030) isn't currently valid input either. I have never seen an expiration date further than 10 years in the future. Although more research on the topic would be needed to figure out the true restrictions.

I think he's suggesting that 113 should be interpreted as 1/13. I'm not sure how simple that logic would be to implement, though.
113 is ambiguous. Its an error