sobhagya-sahu / datejs

Automatically exported from code.google.com/p/datejs
0 stars 0 forks source link

Date.parse(currency) is returning a serial date value #164

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Date.parse("$3,001.10")
2. returns 1267423200000
3. which is Mon Mar 01 2010 00:00:00 GMT-0600 (Central Standard Time)

What is the expected output? What do you see instead?
I expected NaN, see step 2,3

What version of the product are you using? On what operating system?
Chrome Version 23.0.1271.64 m
Windows 7 64 bit

Original issue reported on code.google.com by e...@simpleltc.com on 27 Nov 2012 at 7:03

GoogleCodeExporter commented 8 years ago
Not really a bug - parse is trying to work out what to do with your input.

It's worked out that there is a 3, a 1, and a 10. It makes a best guess that 
this is some crazy form of 3/1/10 and using your dmy order (which is mdy in the 
US) says "Ok, it's the 1st of March 2010".

In other words - it's actually working remarkably well given the crazy input!

Original comment by darkcr...@gmail.com on 9 Sep 2013 at 9:08