14

Ho visitato Eyecon e scaricato il datepicker. Ho tre cartelle. 'css', 'js' e 'less'. Ho incluso le bootstrap-datepicker.js e le ultime jquery.js e collegato la .css nella testa:Come implemento e utilizzo bootstrap-datepicker di eyecon?

<!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> 

Come si può vedere, sto già lavorando con la libreria di bootstrap e sono quindi anche incluso quella.

La mia domanda ora è: come implementare e chiamare la funzione di selezione data?

+0

E che diamine è quello .less nella cartella 'less'? :) –

+5

[LESS is magic;)] (http://lesscss.org/) –

+0

aha, che sembra fantastico :) –

risposta

17

$('element').datepicker(); dove element è una certa classe, id ecc

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

HTML

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

jQuery

$('.datepicker').datepicker();