简体   繁体   English

有没有办法更改为 tempus dominus datetimepicker 设置的图标?

[英]Is there a way to change what icon set for tempus dominus datetimepicker?

I've just started using tempusdominus for Bootstrap 4.0.我刚刚开始在 Bootstrap 4.0 中使用 tempusdominus。 I've got it working all well and integrates nicely with my backend.我让它工作得很好,并与我的后端很好地集成在一起。 However, my site is already using an icon set (material-icons) and I want to see if I can use the icons in this font already.但是,我的网站已经在使用图标集(material-icons),我想看看我是否可以使用这种字体中的图标。

I changed this我改变了这个

<div class="input-group-text"><i class="fa fa-calendar"></i></div>

To use my icon from material-icons.从材料图标中使用我的图标。 However, I can't seem to figure out how to change the icon of the clock.但是,我似乎无法弄清楚如何更改时钟的图标。

I've located it in the Javascript and also looked at the docs and it only seems possible to me to change which Font Awesome icon you use.我已将它定位在 Javascript 并查看了文档,我似乎只能更改您使用的 Font Awesome 图标。

A way I've found is to set each icon you want to change on the picker options:我发现的一种方法是在选择器选项上设置要更改的每个图标:



$('#datepicker').datetimepicker({
    viewMode: 'months',
    format: 'MM/YYYY',
    locale: 'pt_BR',
    icons: {
      time: 'mdi mdi-clock',
      previous: 'mdi mdi-arrow-left',
      next: 'mdi mdi-arrow-left',

    }
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM