Answer the question
In order to leave comments, you need to log in
How to force to read value value for Datepicker calendar?
Hello. I would be grateful for your help in finding a solution.
There is an input. It has a Bootstrap Datepicker calendar hanging on it.
By clicking on a link, the value of the input is set, then when I click on the input, I need its value to be read into the calendar. Now I don’t just not read the value, but even completely delete it when I select nothing in the calendar and click somewhere else in the document.
The bottom line is that I dynamically change the date and I need the calendar to pick up this date.
https://jsfiddle.net/liggth/mg7farve/4/
Answer the question
In order to leave comments, you need to log in
first, you need to do the update like this:
$('#data-date').datepicker('update', '25/01/2019');
and secondly, you have the date format mm.dd.yyyy, i.e. you install 25 month
function changeDate(){
var curr_date = new Date(2019,01,18);
$('#data-date').datepicker("setDate", curr_date );
}
$(document).ready(function() {
$('#data-date').datepicker();
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question