【发布时间】:2015-12-18 15:45:10
【问题描述】:
我有一个基于此 URL 的日历示例: http://eonasdan.github.io/bootstrap-datetimepicker
这是 HTML 代码:
<div class="form-group col-xs-2 col-md-2">
<label for="datebirth" class="control-label">Date of Birth</label>
<div class="input-group date" id="datetimepicker1">
<input type="text" class="form-control" id="date-birth" maxlength="10" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
这是JS代码:
moment.locale('en', {
week: { dow: 1 } // Monday is the first day of the week
});
$("#datetimepicker1").datetimepicker({
format: 'DD/MM/YYYY'
});
$("#date-birth").on("focus", function() {
//open calendar
});
我的日历必须在单击日历图标(这没关系)并且输入日期获得焦点时打开,之后,如果我在输入日期字段中写一个 fecha,则必须更新日历窗口自动。
在 URL 中,有一个关于无图标(仅限输入字段)的示例:,但我没有得到解决。
感谢您的帮助。
【问题讨论】:
标签: twitter-bootstrap twitter-bootstrap-3 bootstrap-datetimepicker