Bootstrap v4 datepicker

ott*_*tz0 98 twitter-bootstrap bootstrap-4

我正在使用Bootstrap V4为我的新网站看到它在Alpha中.

但是我看不到它的构建中有datepicker.js.

有谁知道这是否会包含在V4中?如果没有,任何人都可以推荐一个好日期选择器?

谢谢

And*_*eba 49

也许你想试试这个:https://bootstrap-datepicker.readthedocs.org/en/latest/index.html

它是Bootstrap风格的灵活的datepicker小部件.

  • 你可以发布你的工作CSS吗?datepicker本身适用于bootstrap 4,但它没有样式. (4认同)
  • @RAC更新,截至今天看来,其中的一些(不稳定)版本对Bootstrap 4来说对我来说非常好https://cdnjs.com/libraries/bootstrap-datepicker/1.7.0-RC3 (2认同)

小智 31

你可以使用它,然后你可以只class从bootstrap中添加一个表单. (无论哪个版本)

<div class="form-group">
 <label >Begin voorverkoop periode</label>
 <input type="date" name="bday" max="3000-12-31" 
        min="1000-01-01" class="form-control">
</div>
<div class="form-group">
 <label >Einde voorverkoop periode</label>
 <input type="date" name="bday" min="1000-01-01"
        max="3000-12-31" class="form-control">
</div>
Run Code Online (Sandbox Code Playgroud)

  • 这不是引导程序控件,而是浏览器datepicker(html5日期输入,并非在每个浏览器中都可用!请参阅https://caniuse.com/#feat=input-datetime) (36认同)
  • 不适用于Safari和IE 11或更早版本 (3认同)

小智 5

当我写这个答案时,大多数bootstrap datepickers都包含在Bootstrap 4中.在我看来,添加最少代码的解决方案是一个jQuery插件.我使用了这个https://plugins.jquery.com/datetimepicker/ - 你可以在这里看到它的用法:https://xdsoft.net/jqplugins/datetimepicker/ 它肯定不如整个BS接口那么流畅,但它只需要它的css和js文件以及已经包含在bootstrap中的jQuery.

  • 这是真的,我尝试了一些gem和lib:https://github.com/tempusdominus/bootstrap-4但它是如此的马车 (3认同)
  • 是啊.... tempusdominus 有很多错误 (2认同)