Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I implement and use eyecon's bootstrap-datepicker?

I visited Eyecon and downloaded the datepicker. I got three folders. 'css', 'js' and 'less'. I have included the bootstrap-datepicker.js and the latest jquery.js and linked the .css in the head:

<!DOCTYPE>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Test</title>
        <link rel="stylesheet" type="text/css" href="../css/datepicker.css">
        <link rel="stylesheet" type="text/css" href="../css/bootstrap.css">
        <link rel="stylesheet" type="text/css" href="../css/bootstrap-responsive.css">


    </head>

    <body>
        <div class="well">
            <!--What should I enter here and where/how do I call the function?-->
        </div>

        <script type="text/javascript" src="../js/jquery.js"></script>
        <script type="text/javascript" src="../js/bootstrap-datepicker.js"></script>
        <script type="text/javascript" src="../js/bootstrap.js"></script>
    </body>
</html>

As one can see, I'm already working with the bootstrap library and have therefore also included that.

My question now is: how do I implement and call the date picker function?

like image 789
XT_Nova Avatar asked Apr 10 '13 20:04

XT_Nova


1 Answers

$('element').datepicker(); where element is some class, id etc.

http://jsfiddle.net/6kk3k/1/

HTML

<input type="text" class="datepicker">

jQuery

$('.datepicker').datepicker();
like image 146
Miljan Puzović Avatar answered Sep 28 '22 18:09

Miljan Puzović