I want to set year of datepicker in edit case
I have created datepicker with year only mode using following code.
$(".datepickeryearonly").datepicker({
autoclose: true,
format: "yyyy",
viewMode: "years",
minViewMode: "years"
});
Now I want to update its value.
I have tried
$('input[name="abcd"]').parents('.datepickeryearonly').first().datepicker('setDate','YYYY');
and
$('input[name="abcd"]').val('YYYY')
which is NOT WORKING.
HTML :
<div class="datepickeryearonly">
<input class="form-control" name="abcd" type="text"/>
</div>