Bootstrap Glyphicons datetimepicker 更改图标
Bootstrap Glyphicons datetimepicker change icons
我正在使用 Bootstrap 日期时间选择器 https://eonasdan.github.io/bootstrap-datetimepicker/
如文档中所述,我使用以下代码成功更改了向上、向下箭头。
$('#datetimepicker7').datetimepicker({
sideBySide: true,
icons: {
up: "fa fa-chevron-circle-up",
down: "fa fa-chevron-circle-down",
}
});
请问如何更改日历的左右图标?为了便于理解,我在下图中突出显示了要更改的图标。
非常感谢任何帮助。
为了改变左右图标你只需要改变下面的代码:
icons: {
time: 'glyphicon glyphicon-time',
date: 'glyphicon glyphicon-calendar',
up: 'glyphicon glyphicon-chevron-up',
down: 'glyphicon glyphicon-chevron-down',
//previous: 'glyphicon glyphicon-chevron-left',
previous: 'glyphicon glyphicon-backward',
next: 'glyphicon glyphicon-chevron-right',
today: 'glyphicon glyphicon-screenshot',
clear: 'glyphicon glyphicon-trash',
close: 'glyphicon glyphicon-remove'
},
默认情况下,我评论过的那行显示图标,所以如果您需要更改该图标,您只需设置路径或您想要显示的任何图标。
您可以参考下面link:
https://eonasdan.github.io/bootstrap-datetimepicker/Options/
您只需按照 docs.
中所述,在您的 icons
对象中插入 previous
和 next
键
$('#datetimepicker7').datetimepicker({
sideBySide: true,
icons: {
up: "fa fa-chevron-circle-up",
down: "fa fa-chevron-circle-down",
next: 'fa fa-chevron-circle-right',
previous: 'fa fa-chevron-circle-left'
}
});
<link href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.css" rel="stylesheet"/>
<link href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.37/css/bootstrap-datetimepicker.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.css" rel="stylesheet"/>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.13.0/moment.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.37/js/bootstrap-datetimepicker.min.js"></script>
<div class="form-group">
<div class="input-group date" id="datetimepicker7">
<input type="text" class="form-control" />
<span class="input-group-addon"><span class="glyphicon-calendar glyphicon"></span></span>
</div>
</div>
我正在使用 Bootstrap 日期时间选择器 https://eonasdan.github.io/bootstrap-datetimepicker/
如文档中所述,我使用以下代码成功更改了向上、向下箭头。
$('#datetimepicker7').datetimepicker({
sideBySide: true,
icons: {
up: "fa fa-chevron-circle-up",
down: "fa fa-chevron-circle-down",
}
});
请问如何更改日历的左右图标?为了便于理解,我在下图中突出显示了要更改的图标。
非常感谢任何帮助。
为了改变左右图标你只需要改变下面的代码:
icons: {
time: 'glyphicon glyphicon-time',
date: 'glyphicon glyphicon-calendar',
up: 'glyphicon glyphicon-chevron-up',
down: 'glyphicon glyphicon-chevron-down',
//previous: 'glyphicon glyphicon-chevron-left',
previous: 'glyphicon glyphicon-backward',
next: 'glyphicon glyphicon-chevron-right',
today: 'glyphicon glyphicon-screenshot',
clear: 'glyphicon glyphicon-trash',
close: 'glyphicon glyphicon-remove'
},
默认情况下,我评论过的那行显示图标,所以如果您需要更改该图标,您只需设置路径或您想要显示的任何图标。
您可以参考下面link: https://eonasdan.github.io/bootstrap-datetimepicker/Options/
您只需按照 docs.
中所述,在您的icons
对象中插入 previous
和 next
键
$('#datetimepicker7').datetimepicker({
sideBySide: true,
icons: {
up: "fa fa-chevron-circle-up",
down: "fa fa-chevron-circle-down",
next: 'fa fa-chevron-circle-right',
previous: 'fa fa-chevron-circle-left'
}
});
<link href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.css" rel="stylesheet"/>
<link href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.37/css/bootstrap-datetimepicker.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.css" rel="stylesheet"/>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.13.0/moment.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.37/js/bootstrap-datetimepicker.min.js"></script>
<div class="form-group">
<div class="input-group date" id="datetimepicker7">
<input type="text" class="form-control" />
<span class="input-group-addon"><span class="glyphicon-calendar glyphicon"></span></span>
</div>
</div>