spadgos / sublime-jsdocs

Simplifies writing DocBlock comments in Javascript, PHP, CoffeeScript, Actionscript, C & C++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change Date

SpringsTea opened this issue · comments

I'm going to have an aneurysm. I know this stuff is all over here, and there's tons of answers to this question, but non of them WORK.

I'm just trying to change the chosen date of a picker. Thats all. How easy.

Heres my input:
<input type="text" class="input-small form-control" name="start" id="date-range-start" />

I have a picker that does some stuff:

$('#date-range-start').datepicker({
  defaultDate:'now',
    startDate: startDate,
    endDate: ToEndDate,
    autoclose: true
})
  .on('changeDate', function(selected){
      startDate = new Date(selected.date.valueOf()+ 1000*3600*24);
      startDate.setDate(startDate.getDate(new Date(selected.date.valueOf())));
      $('#date-range-end').datepicker('setStartDate', startDate);
      filterTable();
  });

And basically I want to be able to programatically set the selected date when I do something somewhere else. Theres a billion different ways people give to set the date including:

$('#date-range-start').datepicker("update", new Date());
$('#date-range-start').datepicker('update', '2015-01-01');
$('#date-range-start').datepicker('setDate',new Date());
$('#date-range-start').datepicker("update", new Date());
$('#date-range-start').data({date: '2015-01-01'});

and many others that I've tried and forgotten. Sometimes people say 'aw you gotta refresh the picker with $('#date-range-start').datepicker("update"); and some people don't seem to need it, but nothing works for me. Theres no error, they all return the input item, they all remain blank.

Help me I'm dying.

You've definitely got the wrong repo. Try Stack Overflow for more help.

Shit man.