Javascript: Set default value using DateTimePicker

0

Using JQuery within Angular with the following code:

$('#fecha_ingreso').datetimepicker({
    defaultDate: new Date('08/08/2012')
});

HTML:

<input type="text"
    class="form-control" 
    id="fecha_ingreso"
    formControlName="fecha_ingreso" 
    name="fecha_ingreso">

And although the calendar is displayed without any problem, I can not assign that date with the default value.

[EDITO]

Plugin URL: link

[REPO] link

What am I doing wrong?

    
asked by Ricky 28.12.2017 в 21:16
source

1 answer

1

You are entering the default format incorrectly.

must be a string format of type: YYYY / MM / DD

    
answered by 29.12.2017 в 05:12