开发者

is this a bug in Date.js?

i am using date.js to parse date in my javascript code

i just found an issue where i pass in

"12 Aug 2011" into a Date.Parse() method and it returns August 1, 2011.

here is a screenshot of the input string (as you can see i am passing in "12 Aug 2开发者_JS百科011"):

is this a bug in Date.js?

and here is a screenshot of the output date after the parse (as you can see it thinks its Aug 1 2011):

is this a bug in Date.js?

Is there anything i am doing wrong here or is this a bug in the library


I can confirm that there is an error with date.js and its handling of August dates (in the format of Aug). However, the error is specific to the packaged version of the JS. If you use, the JS located at http://www.datejs.com/build/date.js, the error is resolved.


No, it's not a bug in date.js. Go to the page you linked us to an enter 12 Aug 2011. It parses it just fine. There's a bug in your code somewhere.

Here's a fiddle as proof:

http://jsfiddle.net/mnbayazit/J3dnu/


looks like i have to use parseExact()

 Date.parseExact(startingMilestone, "d MMM yyyy");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜