Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
110
rated 0 times [  112] [ 2]  / answers: 1 / hits: 15745  / 9 Years ago, wed, november 25, 2015, 12:00:00

So I'm using http://amsul.ca/pickadate.js/ and I can't seem to figure out how to set a specific date into the date picker.
(Date picker for pickadate.js v3.5.6, http://amsul.github.io/pickadate.js/date.htm).



For example if I say:



var today = '01-01-1983';
picker.val(today);


This will change the text inside the input, but when you open the picker the date has not been set to 1983.



So how do you use js/jquery to update the date in the date picker?


More From » jquery

 Answers
8
  //try this  
var date = new Date(1983, 1, 1);
var picker = $('#date_picker').pickadate('picker');
picker.set('select', date);

[#64273] Monday, November 23, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
anitamaeg

Total Points: 466
Total Questions: 106
Total Answers: 106

Location: Suriname
Member since Sun, Jun 13, 2021
3 Years ago
;