What is the difference between
new Date(2013,0,1)
and
Date.parse("2013-1-1")
that breaks
Here is jsfiddle /
What is the difference between
new Date(2013,0,1)
and
Date.parse("2013-1-1")
that breaks http://api.jqueryui./datepicker/#method-setDate
Here is jsfiddle http://jsfiddle/tawVx/4/
Share Improve this question asked Nov 14, 2012 at 15:48 tomaszbaktomaszbak 8,2874 gold badges46 silver badges37 bronze badges 01 Answer
Reset to default 3Date.parse() returns the number of milliseconds elapsed since January 1st, 1970, 00:00:00 UTC, not a Date
object.
setDate() takes either a Date
object or a string, not a number of milliseconds elapsed since the epoch.
The following code would work:
$("#datepicker").datepicker("setDate", new Date(Date.parse("2013-01-01")));
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745266005a4619459.html
评论列表(0条)