twitter bootstrap - jQuery datepicker: options ignored selecting the text field -


i'm trying use datepicker https://bootstrap-datepicker.readthedocs.org/en/latest/

into specific i'm using "component" view, text field button ar side.

i've set datepicker ask year (among decades), month , day, i've set language italian , date format dd/mm/yyyy.

that works correctly if use button select date, if give focus text field, datepicker appears default view: montly view pick date, english language , mm/dd/yyyy format date.

this code in use:

<input data-provide="datepicker" class="form-control" id="birthdate" placeholder="data di nascita" readonly="readonly" name="birthdate" type="text"><span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span>  $('.input-group.date').datepicker({ format: "dd/mm/yyyy", weekstart: 1, startview: 2, clearbtn: true, language: "it", autoclose: true}); 

you can see example here: http://www.luigicaradonna.it/datepicker/prova.php

try click button , select date, that's how should work, reload page , click on text field, that's wrong behaviour.

what doing wrong?

the problem have input this

<div class="input-group date">     <input data-provide="datepicker" type="text" class="form-control"><span class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span> </div> 

you can see data-provide="datepicker" in input. that's cause not working expected. don't know if that's neccesary if remove data-provide="datapicker" should work fine.

<div class="input-group date">     <input type="text" class="form-control"><span class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span> </div> 

i run test sample codes , way works me. hope helps


Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -