|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644 |
- #Bootstrap 3 Datepicker v4 Docs
-
- <div class="alert alert-info">
- <strong>Note</strong>
- All functions are accessed via the <code>data</code> attribute e.g. <code>$('#datetimepicker').data("DateTimePicker").FUNCTION()</code>
- </div>
-
- ### Minimum Setup
-
- <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>
- <script type="text/javascript">
- $(function () {
- $('#datetimepicker1').datetimepicker();
- });
- </script>
- </div>
- </div>
-
- #### Code
-
- ```
- <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>
- <script type="text/javascript">
- $(function () {
- $('#datetimepicker1').datetimepicker();
- });
- </script>
- </div>
- </div>
- ```
-
- ----------------------
-
- ### Using Locales
-
- <div class="container">
- <div class="row">
- <div class='col-sm-6'>
- <div class="form-group">
- <div class='input-group date' id='datetimepicker2'>
- <input type='text' class="form-control" />
- <span class="input-group-addon">
- <span class="glyphicon glyphicon-calendar"></span>
- </span>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- $(function () {
- $('#datetimepicker2').datetimepicker({
- locale: 'ru'
- });
- });
- </script>
- </div>
- </div>
-
- #### Code
-
- ```
- <div class="container">
- <div class="row">
- <div class='col-sm-6'>
- <div class="form-group">
- <div class='input-group date' id='datetimepicker2'>
- <input type='text' class="form-control" />
- <span class="input-group-addon">
- <span class="glyphicon glyphicon-calendar"></span>
- </span>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- $(function () {
- $('#datetimepicker2').datetimepicker({
- locale: 'ru'
- });
- });
- </script>
- </div>
- </div>
- ```
-
- ----------------------
-
- ### Time Only
-
- <div class="container">
- <div class="row">
- <div class='col-sm-6'>
- <div class="form-group">
- <div class='input-group date' id='datetimepicker3'>
- <input type='text' class="form-control" />
- <span class="input-group-addon">
- <span class="glyphicon glyphicon-time"></span>
- </span>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- $(function () {
- $('#datetimepicker3').datetimepicker({
- format: 'LT'
- });
- });
- </script>
- </div>
- </div>
-
- #### Code
-
- ```
- <div class="container">
- <div class="row">
- <div class='col-sm-6'>
- <div class="form-group">
- <div class='input-group date' id='datetimepicker3'>
- <input type='text' class="form-control" />
- <span class="input-group-addon">
- <span class="glyphicon glyphicon-time"></span>
- </span>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- $(function () {
- $('#datetimepicker3').datetimepicker({
- format: 'LT'
- });
- });
- </script>
- </div>
- </div>
- ```
-
- ----------------------
-
- ### Date Only
-
- <div class="container">
- <div class="row">
- <div class='col-sm-6'>
- <div class="form-group">
- <div class='input-group date' id='datetimepicker3'>
- <input type='text' class="form-control" />
- <span class="input-group-addon">
- <span class="glyphicon glyphicon-time"></span>
- </span>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- $(function () {
- $('#datetimepicker3').datetimepicker({
- format: 'L'
- });
- });
- </script>
- </div>
- </div>
-
- #### Code
-
- ```
- <div class="container">
- <div class="row">
- <div class='col-sm-6'>
- <div class="form-group">
- <div class='input-group date' id='datetimepicker3'>
- <input type='text' class="form-control" />
- <span class="input-group-addon">
- <span class="glyphicon glyphicon-time"></span>
- </span>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- $(function () {
- $('#datetimepicker3').datetimepicker({
- format: 'LT'
- });
- });
- </script>
- </div>
- </div>
- ```
-
- ----------------------
-
- ### No Icon (input field only):
-
- <div class="container">
- <div class="row">
- <div class='col-sm-6'>
- <input type='text' class="form-control" id='datetimepicker4' />
- </div>
- <script type="text/javascript">
- $(function () {
- $('#datetimepicker4').datetimepicker();
- });
- </script>
- </div>
- </div>
-
- #### Code
-
- ```
-
- <div class="container">
- <div class="row">
- <div class='col-sm-6'>
- <input type='text' class="form-control" id='datetimepicker4' />
- </div>
- <script type="text/javascript">
- $(function () {
- $('#datetimepicker4').datetimepicker();
- });
- </script>
- </div>
- </div>
- ```
-
- ----------------------
-
- ### Enabled/Disabled Dates
-
- <div class="container">
- <div class="row">
- <div class='col-sm-6'>
- <div class="form-group">
- <div class='input-group date' id='datetimepicker5'>
- <input type='text' class="form-control" />
- <span class="input-group-addon">
- <span class="glyphicon glyphicon-calendar"></span>
- </span>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- $(function () {
- $('#datetimepicker5').datetimepicker({
- defaultDate: "11/1/2013",
- disabledDates: [
- moment("12/25/2013"),
- new Date(2013, 11 - 1, 21),
- "11/22/2013 00:53"
- ]
- });
- });
- </script>
- </div>
- </div>
-
- #### Code
-
- ```
- <div class="container">
- <div class="row">
- <div class='col-sm-6'>
- <div class="form-group">
- <div class='input-group date' id='datetimepicker5'>
- <input type='text' class="form-control" />
- <span class="input-group-addon">
- <span class="glyphicon glyphicon-calendar"></span>
- </span>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- $(function () {
- $('#datetimepicker5').datetimepicker({
- defaultDate: "11/1/2013",
- disabledDates: [
- moment("12/25/2013"),
- new Date(2013, 11 - 1, 21),
- "11/22/2013 00:53"
- ]
- });
- });
- </script>
- </div>
- </div>
- ```
-
- ----------------------
-
- ### Linked Pickers
-
- <div class="container">
- <div class='col-md-5'>
- <div class="form-group">
- <div class='input-group date' id='datetimepicker6'>
- <input type='text' class="form-control" />
- <span class="input-group-addon">
- <span class="glyphicon glyphicon-calendar"></span>
- </span>
- </div>
- </div>
- </div>
- <div class='col-md-5'>
- <div class="form-group">
- <div class='input-group date' id='datetimepicker7'>
- <input type='text' class="form-control" />
- <span class="input-group-addon">
- <span class="glyphicon glyphicon-calendar"></span>
- </span>
- </div>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- $(function () {
- $('#datetimepicker6').datetimepicker();
- $('#datetimepicker7').datetimepicker({
- useCurrent: false
- });
- $("#datetimepicker6").on("dp.change", function (e) {
- $('#datetimepicker7').data("DateTimePicker").minDate(e.date);
- });
- $("#datetimepicker7").on("dp.change", function (e) {
- $('#datetimepicker6').data("DateTimePicker").maxDate(e.date);
- });
- });
- </script>
-
- #### Code
-
- ```
- <div class="container">
- <div class='col-md-5'>
- <div class="form-group">
- <div class='input-group date' id='datetimepicker6'>
- <input type='text' class="form-control" />
- <span class="input-group-addon">
- <span class="glyphicon glyphicon-calendar"></span>
- </span>
- </div>
- </div>
- </div>
- <div class='col-md-5'>
- <div class="form-group">
- <div class='input-group date' id='datetimepicker7'>
- <input type='text' class="form-control" />
- <span class="input-group-addon">
- <span class="glyphicon glyphicon-calendar"></span>
- </span>
- </div>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- $(function () {
- $('#datetimepicker6').datetimepicker();
- $('#datetimepicker7').datetimepicker({
- useCurrent: false //Important! See issue #1075
- });
- $("#datetimepicker6").on("dp.change", function (e) {
- $('#datetimepicker7').data("DateTimePicker").minDate(e.date);
- });
- $("#datetimepicker7").on("dp.change", function (e) {
- $('#datetimepicker6').data("DateTimePicker").maxDate(e.date);
- });
- });
- </script>
- ```
-
- ----------------------
-
- ### Custom Icons
-
- <div class="container">
- <div class="col-sm-6" style="height:130px;">
- <div class="form-group">
- <div class='input-group date' id='datetimepicker8'>
- <input type='text' class="form-control" />
- <span class="input-group-addon">
- <span class="fa fa-calendar">
- </span>
- </span>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- $(function () {
- $('#datetimepicker8').datetimepicker({
- icons: {
- time: "fa fa-clock-o",
- date: "fa fa-calendar",
- up: "fa fa-arrow-up",
- down: "fa fa-arrow-down"
- }
- });
- });
- </script>
- </div>
-
- #### Code
-
- ```
- <div class="container">
- <div class="col-sm-6" style="height:130px;">
- <div class="form-group">
- <div class='input-group date' id='datetimepicker8'>
- <input type='text' class="form-control" />
- <span class="input-group-addon">
- <span class="fa fa-calendar">
- </span>
- </span>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- $(function () {
- $('#datetimepicker8').datetimepicker({
- icons: {
- time: "fa fa-clock-o",
- date: "fa fa-calendar",
- up: "fa fa-arrow-up",
- down: "fa fa-arrow-down"
- }
- });
- });
- </script>
- </div>
- ```
-
- ----------------------
-
- ### View Mode
-
- <div class="container">
- <div class="col-sm-6" style="height:130px;">
- <div class="form-group">
- <div class='input-group date' id='datetimepicker9'>
- <input type='text' class="form-control" />
- <span class="input-group-addon">
- <span class="glyphicon glyphicon-calendar">
- </span>
- </span>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- $(function () {
- $('#datetimepicker9').datetimepicker({
- viewMode: 'years'
- });
- });
- </script>
- </div>
-
- #### Code
-
- ```
- <div class="container">
- <div class="col-sm-6" style="height:130px;">
- <div class="form-group">
- <div class='input-group date' id='datetimepicker9'>
- <input type='text' class="form-control" />
- <span class="input-group-addon">
- <span class="glyphicon glyphicon-calendar">
- </span>
- </span>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- $(function () {
- $('#datetimepicker9').datetimepicker({
- viewMode: 'years'
- });
- });
- </script>
- </div>
- ```
-
- ----------------------
-
- ### Min View Mode
-
- <div class="container">
- <div class="col-sm-6" style="height:130px;">
- <div class="form-group">
- <div class='input-group date' id='datetimepicker10'>
- <input type='text' class="form-control" />
- <span class="input-group-addon">
- <span class="glyphicon glyphicon-calendar">
- </span>
- </span>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- $(function () {
- $('#datetimepicker10').datetimepicker({
- viewMode: 'years',
- format: 'MM/YYYY'
- });
- });
- </script>
- </div>
-
- #### Code
-
- ```
- <div class="container">
- <div class="col-sm-6" style="height:130px;">
- <div class="form-group">
- <div class='input-group date' id='datetimepicker10'>
- <input type='text' class="form-control" />
- <span class="input-group-addon">
- <span class="glyphicon glyphicon-calendar">
- </span>
- </span>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- $(function () {
- $('#datetimepicker10').datetimepicker({
- viewMode: 'years',
- format: 'MM/YYYY'
- });
- });
- </script>
- </div>
-
- ```
-
- ----------------------
-
- ### Disabled Days of the Week
-
- <div class="container">
- <div class="col-sm-6" style="height:130px;">
- <div class="form-group">
- <div class='input-group date' id='datetimepicker11'>
- <input type='text' class="form-control" />
- <span class="input-group-addon">
- <span class="glyphicon glyphicon-calendar">
- </span>
- </span>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- $(function () {
- $('#datetimepicker11').datetimepicker({
- daysOfWeekDisabled: [0, 6]
- });
- });
- </script>
- </div>
-
- #### Code
-
- ```
- <div class="container">
- <div class="col-sm-6" style="height:130px;">
- <div class="form-group">
- <div class='input-group date' id='datetimepicker11'>
- <input type='text' class="form-control" />
- <span class="input-group-addon">
- <span class="glyphicon glyphicon-calendar">
- </span>
- </span>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- $(function () {
- $('#datetimepicker11').datetimepicker({
- daysOfWeekDisabled: [0, 6]
- });
- });
- </script>
- </div>
- ```
-
- ----------------------
-
- ### Inline
-
- <div style="overflow:hidden;">
- <div class="form-group">
- <div class="row">
- <div class="col-md-8">
- <div id="datetimepicker12"></div>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- $(function () {
- $('#datetimepicker12').datetimepicker({
- inline: true,
- sideBySide: true
- });
- });
- </script>
- </div>
-
- #### Code
-
- ```
- <div style="overflow:hidden;">
- <div class="form-group">
- <div class="row">
- <div class="col-md-8">
- <div id="datetimepicker12"></div>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- $(function () {
- $('#datetimepicker12').datetimepicker({
- inline: true,
- sideBySide: true
- });
- });
- </script>
- </div>
- ```
|