bootstrap中怎么实现年月日时间选择

bootstrap中怎么实现年月日时间选择

这篇文章给大家介绍bootstrap中怎么实现年月日时间选择,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。

1、CSS文件:bootstrap.min.css、bootstrap-datetimepicker.min.css

2、JS文件:jquery-1.8.3.min.js、bootstrap.min.js、bootstrap-datetimepicker.js、bootstrap-datetimepicker.zh-CN.js

使用bootstrap实现年份的选择。

bootstrap配置代码如下:

<script type="text/javascript">$('.form_datetime').datetimepicker({    language:  'zh-CN',    minView: 4,         format: 'yyyy',    startDate:2019,    autoclose: 1,    startView: 4,});</script>

使用bootstrap实现月份的选择。

bootstrap配置代码如下:

<script type="text/javascript">$('.form_datetime').datetimepicker({    format: 'mm',    autoclose:true,    startView:3,    minView:3,    maxView:3,    initialDate:new Date(),    language:'zh-CN'});</script>

使用bootstrap实现年月日的选择。

bootstrap配置代码如下:

<script type="text/javascript">$('.form_datetime').datetimepicker({     format: 'yyyymmdd',     weekStart: 1,     autoclose: true,     startView: 2,     minView: 2,    language:'zh-CN'});</script>

关于bootstrap中怎么实现年月日时间选择就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。