Hacker News new | ask | show | jobs
by dasil003 4880 days ago
Huh? If you literally type '1/13' into the live demo it works as one would expect. '113' works too, it just assumes the month is eleven, and the year starts with 3.
2 comments

If you literally type '1/13' into the live demo it interprets it as '11/3' because it does not allow a '/' character to be entered as cpeterso mentioned
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".
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?
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