Adding a DATETIME picker to bootstrap

Experts,

I am trying to add a datetime picker to a twitter bootstrap 3 project, but am having problems getting the code to work...

The resource i am using is from this website: https://eonasdan.github.io/bootstrap-datetimepicker/

First off, i dont have a lot of experience using JQuery, so this may be very obvious...

I have tried downloading then linking to the assets where necessary, and also tried to use the CDN options if available. I would be grateful if someone could help identify what im missing and help get the example here working:
http://www.suremedia.co.uk/ee-test/datetime.htm

Regards
Dean
LVL 12
Dean OBrienAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Julian HansenCommented:
Firstly, you have an appendage on your declaration below
<script type="text/javascript">
$(function () {
  $('#datetimepicker1').data("DateTimePicker").FUNCTION()
});
</script>

Open in new window

If you refer to the sample on the GiT page it looks like this
$(function () {
  $('#datetimepicker1').datetimepicker();
});

Open in new window

The .FUNCTION() is a placeholder for a function name that you might want to call.

I think your library includes may be a bit screwy -
Taking the following 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>
    </div>    

Open in new window

jQuery
$(function() {
  $('#datetimepicker1').datetimepicker();
});

Open in new window

Full working sample here

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dean OBrienAuthor Commented:
Top Marks, Thanks Julian.

Think i was confusing a couple of examples i found... perhaps using old versions of the plugin files as well. For your example, did you get plugin from the bootstrap website? I couldnt find an easy way to download most recent.

Regards
Dean
Julian HansenCommented:
You are welcome Dean
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
jQuery

From novice to tech pro — start learning today.