最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin0浏览0评论

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?

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?

Share Improve this question edited Dec 15, 2013 at 18:12 Mark Amery 155k90 gold badges428 silver badges470 bronze badges asked Apr 10, 2013 at 20:25 XT_NovaXT_Nova 1,1705 gold badges17 silver badges34 bronze badges 4
  • And what tha heck is that .less in the 'less' folder? :) – XT_Nova Commented Apr 10, 2013 at 20:30
  • 5 LESS is magic ;) – Miljan Puzović Commented Apr 10, 2013 at 20:35
  • aha, that looks awesome :) – XT_Nova Commented Apr 10, 2013 at 22:00
  • Yup. You could also take a look at SASS – Miljan Puzović Commented Apr 10, 2013 at 22:02
Add a comment  | 

1 Answer 1

Reset to default 17

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

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

HTML

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

jQuery

$('.datepicker').datepicker();
发布评论

评论列表(0)

  1. 暂无评论