D
D
Dmitry2019-02-19 08:15:05
JavaScript
Dmitry, 2019-02-19 08:15:05

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

2 answer(s)
2
2cha.headz, 2019-02-19
@glagolew059

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

L
Larisa .•º, 2019-02-19
@barolina

function changeDate(){
    var curr_date = new Date(2019,01,18);
    $('#data-date').datepicker("setDate", curr_date ); 
}

$(document).ready(function() {
      $('#data-date').datepicker();
});

have fun! )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question