smalot / bootstrap-datetimepicker

Both Date and Time picker widget based on twitter bootstrap (supports Bootstrap v2 and v3)
http://www.malot.fr/bootstrap-datetimepicker/
Apache License 2.0
3.49k stars 1.65k forks source link

When use the option forceParse. Date Picker doesn't initialice with the current date #700

Open Reyniergc opened 6 years ago

Reyniergc commented 6 years ago

When use the option forceParse in the initialization of the date Picker doesn't initialice with the current date and the value displayed in the input is the following: 31/12/1899 - 00:00 But I want the current value if the user insert a wrong value with the option forceParse . Thank very much.

<div class="form-group">
<label for="dtp_input1" class="col-md-2 control-label">DateTime Picking</label> 
<div class="input-group date form_date col-md-5"  data-date-format="dd/mm/yyyy - HH:ii" data-link-field="dtp_input1">
<input id="datetimepicker" class="form-control" size="16" type="text" value="">
<span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
<span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>
</div>
<input type="hidden" id="dtp_input1" value="" /><br/>
</div>
   $('.form_date').datetimepicker({
        language:  'pt',
    forceParse: 1
    });