0

I am trying to put bootstrap datetimepicker plugin in my web app and followed every installation instructions properly but it won't work so I tried the examples of others in jsfiddle referenced from here but they too not work. Is is in my browser or I just forgot to include some requirements. Here is my header:

<!-- BOOTSTRAP TIMEPICKER -->
<link href="<?php echo base_url('assets/css/bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css');?>"

and here is my footer:

<!-- JQUERY TIMEPICKER -->
<script src="<?php echo base_url('assets/js/moment/min/moment.min.js');?>"></script>
<script src="<?php echo base_url('assets/js/bootstrap-datetimepicker.min.js');?>"></script>

and here is the html:

               <tr>
            <td><label class='control-label'>Time In:</label></td>
             <td><div class='input-group date' id='TimeIn'>
             <input type='text' class='form-control' value='".@date('H:i',@strtotime($val['TimeIn']))."' id='txtTimeIn'/><span class='input-group-addon'><i class='glyphicon glyphicon-time'></i></span>
             </div></td>
              </tr>

And here is the jquery:

$(function(){
$('#TimeIn').datetimepicker({
    format: 'LT'
});
});
SilverRay
  • 331
  • 2
  • 7
  • 23

2 Answers2

0

Show the datetimepicker after initializing

$(function(){
$('#TimeIn').datetimepicker({
    format: 'LT'
});
$("#Timein").datetimepicker("show");
});
Arumuga Raja
  • 184
  • 13
  • I tried but still not working. I tried also this timepicker http://jdewit.github.io/bootstrap-timepicker/ but same thing not working. Please note that I have a calendar plugin. Is ymy calendar can also affect the functionality of other plugins? – SilverRay Apr 14 '16 at 10:40
  • Why you use separate plugins. Use the `datetimepicker` alone where you can use both calendar and time and only a calendar if needed. – Arumuga Raja Apr 14 '16 at 10:42
  • I will try to disable the calendar see if it will work. – SilverRay Apr 14 '16 at 10:48
  • Can you please make the fiddle and share – Arumuga Raja Apr 14 '16 at 10:49
  • http://stackoverflow.com/questions/23512319/how-do-i-make-a-script-public-in-jsfiddle – Arumuga Raja Apr 14 '16 at 11:01
  • Is it working after changed that? Working means happy : ) – Arumuga Raja Apr 14 '16 at 11:33
  • due to my frustration I just used the built in time type input of bootstrap but no animation or flashy what so over just like an ordinary text input with time validation only.... :( – SilverRay Apr 14 '16 at 11:53
0

I didn't use it before but i searched and i found some exmaples. You used <i> inside <span> but you didn't add icon's attributes

<i data-time-icon="icon-time" data-date-icon="icon-calendar">

check this link https://tarruda.github.io/bootstrap-datetimepicker/

Owais Aslam
  • 1,577
  • 1
  • 17
  • 39