abritinthebay / datejs

DateJS: Evolved. An updated, bug fixed, and actively maintained continuation of DateJS
Other
354 stars 79 forks source link

Date parse is too permissive in some cases #223

Open cowsrule opened 9 years ago

cowsrule commented 9 years ago

Date.parse("e 3") Thu Mar 01 2001 00:00:00 GMT-0800 (Pacific Standard Time)

Date.parse("zzz 3") Thu Mar 01 2001 00:00:00 GMT-0800 (Pacific Standard Time)

Date.parse("3") Sun Mar 01 2015 00:00:00 GMT-0800 (Pacific Standard Time)

Date.parse("3th") Sun Mar 01 2015 00:00:00 GMT-0800 (Pacific Standard Time)

Date.parse("zzzzzzzzzz 3th") Thu Mar 01 2001 00:00:00 GMT-0800 (Pacific Standard Time)

abritinthebay commented 9 years ago

wow, that's just... huh. Looks like it's seeing 3 and picking March (sort of right... sorta... a method to the madness at least)

Going on record: I hate this parser implementation. That's going to be the big v2 change I feel...

cowsrule commented 9 years ago

I've spent some time trying to bend the parser to my will and it's been slow going... I can totally get behind that :).