I'm implementing edit user functionality. This is my jquery code for datepicker
$('#companybegindate').datepicker({
autoclose: true,
dateFormat: 'yy',
changeYear: true
});
And this is HTML
<input type="text" class="form-control pull-right" name="companybegindate" id="companybegindate" value="">
My question is if I'm fetching any date from database , how can i set that date to datepicker by default ??
Suppose I'm getting '2016-06-20', how can I set this date to datepicker by default. Any help is much appreciated..Thanks.