twitter-bootstrap Bootstrap v4 日期选择器
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33870344/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Bootstrap v4 datepicker
提问by ottz0
I'm using Bootstrap V4 for my new website seeing that it is in Alpha.
我正在将 Bootstrap V4 用于我的新网站,因为它处于 Alpha 状态。
However I cannot see that it has datepicker.js in its build.
但是我看不到它的构建中有 datepicker.js。
Does anyone know if this will be included in V4? If not can anyone recommend a good datepicker?
有谁知道这是否会包含在 V4 中?如果没有,有人可以推荐一个好的日期选择器吗?
采纳答案by Andrey Saleba
Maybe you want to try this: https://bootstrap-datepicker.readthedocs.org/en/latest/index.html
也许你想试试这个:https: //bootstrap-datepicker.readthedocs.org/en/latest/index.html
It's a flexible datepicker widget in the Bootstrap style.
它是一个灵活的 Bootstrap 风格的日期选择器小部件。
回答by sadeq alshaar
You can use this and then you can add just a classform from bootstrap.
(does not matter which version)
您可以使用它,然后您可以class从引导程序中添加一个表单。
(哪个版本无所谓)
<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>
回答by Slinky Sloth
Most of bootstrap datepickers as I write this answer are rather buggy when included in Bootstrap 4. In my view the least code adding solution is a jQuery plugin. I used this one https://plugins.jquery.com/datetimepicker/- you can see its usage here: https://xdsoft.net/jqplugins/datetimepicker/It sure is not as smooth as the whole BS interface, but it only requires its css and js files along with jQuery which is already included in bootstrap.
当我写这个答案时,大多数引导程序日期选择器在包含在 Bootstrap 4 中时都相当有问题。在我看来,添加代码最少的解决方案是 jQuery 插件。我使用了这个https://plugins.jquery.com/datetimepicker/- 你可以在这里看到它的用法:https: //xdsoft.net/jqplugins/datetimepicker/它肯定不像整个 BS 界面那么流畅,但它只需要它的 css 和 js 文件以及已经包含在 bootstrap 中的 jQuery。

