sobhagya-sahu / datejs

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

Fail to parse a simple date #123

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. date.parseExact("05/05/2011 08:27","dd/MM/YYYY HH:mm")

What is the expected output? What do you see instead?
I expect the date to be correctly parsed. The return is null or undefined.

What version of the product are you using? On what operating system?
Windows 7 / Firefox 4

Please provide any additional information below.

Original issue reported on code.google.com by andre.rodier on 3 Jun 2011 at 3:12

GoogleCodeExporter commented 8 years ago
That's because it's an invalid format. The Y's should be lowercase:

Date.parseExact("05/05/2011","dd/MM/yyyy") works as intended. 

There is no YYYY format so your format means it's looking for "05/05/YYYY" 
which it obviously didn't find. User error, not library error basically :)

Original comment by darkcr...@gmail.com on 16 Sep 2013 at 5:52