JavaScript Cannot configure jQuery datepicker to select default date

I am using the following plugin for a datepicker:

http://xdsoft.net/jqplugins/datetimepicker/

This is a very nice plugin however I am finding it difficult to set a default date when loading the box.

See this fiddle.

$('.datepicker').datepicker();

Box 1 contains 25/12/2013. I want the datepicker to default to this date when the user selects this box. Box 2 contains nothing therefore the box should default to today.

NB This is currently using standard jquery-ui-datepicker.

I have tried setting various options with no success. I have also tried to read where the value is being set but again cannot see where the input is referenced.

Any help would be appreciated.

Answer:1
$('.datepicker').datepicker()
                .filter('[value!=""]')
                .datepicker('setDate', '12/25/13');

FIDDLE

As a sidenote you can set a defaultDate to any datepicker that is submitted if the user doesn't select a date, but that date is not shown as the value of the input

$('.datepicker').datepicker()
                .filter('[value!=""]')
                .datepicker( "option", "defaultDate", '12/25/13' );
Answer:2

I want to perform a custom assertion about the argument passed to a spied-on function call. Can I supply a callback to be used within the expectation against an argument? expect(my.method)....

I want to perform a custom assertion about the argument passed to a spied-on function call. Can I supply a callback to be used within the expectation against an argument? expect(my.method)....

I have an internal form that is web-based. Clients insert their information (Name and such) and sign using a signing pad (This is more than an image. It's the speed, pressure, ect of the signature). ...

I have an internal form that is web-based. Clients insert their information (Name and such) and sign using a signing pad (This is more than an image. It's the speed, pressure, ect of the signature). ...

I have a an array of objects like this in angular: $scope.data = [ {name:"John", group:"a"}, {name:"David", group:"a"}, {name:"Tom", group:"b"}, ]; I want to present this data as ...

I have a an array of objects like this in angular: $scope.data = [ {name:"John", group:"a"}, {name:"David", group:"a"}, {name:"Tom", group:"b"}, ]; I want to present this data as ...

  1. data manipulation angularjs

I'm having this headache now, since I've been having this problem the whole day and, still, can't fix it. I've looked on Google and StackOverflow for hours, tried many methods (including changing from ...

I'm having this headache now, since I've been having this problem the whole day and, still, can't fix it. I've looked on Google and StackOverflow for hours, tried many methods (including changing from ...

  1. jquery json call
  2. jquery json call web service
  3. jquery json call example
  4. jquery call json api
  5. jquery call json file
  6. jquery call json object
  7. jquery ajax json call
  8. jquery ajax json call example
  9. jquery json rest call
  10. jquery call web service json
  11. jquery call json parse
  12. jquery call json url