javascript - datetimepicker bootstrap get value and use it as input undefined bug -
i'm not sure why following happening but, i'm using datetimepicker1 bootstrap, , when try selected value, undefined
var date = $("#datetimepicker1").find("input").val();
but right date when type $("#datetimepicker1").find("input").val();
on console. how can value of date picked/selected can use it?
html
<div class="container"> <div class="row"> <div class='col-sm-6'> <div class="form-group"> <div class='input-group date' id='datetimepicker1'> <input type='text' class="form-control" /> <span class="input-group-addon"> <span class="glyphicon glyphicon-calendar"></span> </span> </div> </div> </div> </div>
also, im trying change format of date "jan 14 2016 hh:min:ss" using "m dd yyyy hh:ii:ss" gives me fri (weekdays) instead of month names... link i'm using 1 enter link description here
try without find.
var date = $("#datetimepicker1").val();
Comments
Post a Comment