Search code examples
datepickerfuelux

setting date of datepicker fuelux


I need to initialize or set a specific date in the datepicker of fuelux.

The DatePicker component works placing today's date by default , but I need set the first of January 2015 (for example "01-01-2015").

The Code js.

$('#myDatepicker1').datepicker({ allowPastDates: true, momentConfig: { culture: 'es', format: 'DD-MM-YYYY' }, restricted: [ {from: '01-01-2013', to: '01-01-2014'} ]
});

In advance thanks for the help you can give me.


Solution

  • Use the setDate method.

    $('#myDatepicker').datepicker('setDate', '01-01-2015'); View documentation.