gpt4 book ai didi

javascript - 时刻日期选择器的设置

转载 作者:行者123 更新时间:2023-12-02 14:16:42 24 4
gpt4 key购买 nike

我正在尝试使用 moment js 进行引导来设置日期和时间选择器。首先我已经设置了这个。

 <div class="form-group">
<div class="col-md-3 col-sm-3 col-xs-3">
<input id="begindateTime" class="form-control has-feedback-left" placeholder="Begin Date Time" type="text" >
</div>
</div>

接下来我要确保这一点。

<!-- daterangepicker -->
<script type="text/javascript" src="js/moment/moment.min.js"></script>
<script type="text/javascript" src="js/datepicker/daterangepicker.js"></script>

接下来我已经设置了这个

<script>

$('#begindateTime').datepicker();

</script>

显示 datetimepicker 不是函数的问题?我需要日期和时间以及小时和分钟选择。我可能缺少什么?

最佳答案

CDN:

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment-with-locales.js"></script>

<script type="text/javascript" src="https://cdn.rawgit.com/Eonasdan/bootstrap-datetimepicker/a549aa8780dbda16f6cff545aeabc3d71073911e/src/js/bootstrap-datetimepicker.js"></script>

<script type="text/javascript" src="https://cdn.rawgit.com/Eonasdan/bootstrap-datetimepicker/a549aa8780dbda16f6cff545aeabc3d71073911e/build/css/bootstrap-datetimepicker.css"></script>

HTML:

<div class="row">
<div class="col-md-12">
<h6>datetimepicker1</h6>

<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-calendar glyphicon"></span></span>
</div>
</div>
<h6>datetimepicker2</h6>
<input type="text" class="form-control" id="datetimepicker2" />
</div>
</div>

JavaScript:

$('#datetimepicker1').datetimepicker();
$('#datetimepicker2').datetimepicker();

使用此代码..

这对你有用..

关于javascript - 时刻日期选择器的设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38959754/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com