Hacker News new | ask | show | jobs
by sethist 4880 days ago
This looks nice, but I ran into an immediate usability issue. The Card Expiry requires a leading 0 for January. It seems like bad UI to prevent a user from enter 1/13 or 1/2013 in those fields.
1 comments

We don't prevent that. If you type '1/' the library turns it into '01 / '.
Fair enough, I haven't dug into the code yet. I was basing my comment on the live demo which prevents it.
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.
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.
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.
The example page on github has an "Expiry formatting" field that says it expects "MM/YY", but it does not allow a '/' character to be entered:

http://stripe.github.com/jquery.payment/example/