简体   繁体   English

Tempus Dominus Datetimepicker:即使切换到日期日历模式也始终显示时钟图标

[英]Tempus Dominus Datetimepicker: Clock icon always displayed even when switching to Date Calendar mode

JSFiddle: https://jsfiddle.net/6nys2puv/ JSFiddle: https ://jsfiddle.net/6nys2puv/

I'm using the following:我正在使用以下内容:

  • jQuery 3.6.0 jQuery 3.6.0
  • Bootstrap 4.6.2引导程序 4.6.2
  • Font-Awesome 6.1.0 ("all" files) Font-Awesome 6.1.0(“所有”文件)
  • Tempus Dominus 5.39.0主宰之时 5.39.0

In the Tempus Dominus datetimepicker, when switching back to the Calendar view from the Time view, the icon is still Clock even though it's supposed to be Calendar.在 Tempus Dominus 日期时间选择器中,当从时间视图切换回日历视图时,图标仍然是时钟,即使它应该是日历。 So the Clock icon is incorrectly used for both modes.因此,两种模式都错误地使用了时钟图标。

Note that the icons are explicitly specified as follows:请注意,图标明确指定如下:

$('#datetimepicker1').datetimepicker({
    allowInputToggle: true,
    icons: {
        time: 'far fa-clock',
        date: 'far fa-calendar',
        up: 'fas fa-arrow-up',
        down: 'fas fa-arrow-down',
        previous: 'fas fa-chevron-left',
        next: 'fas fa-chevron-right',
        today: 'far fa-calendar-check-o',
        clear: 'far fa-trash',
        close: 'far fa-times'
    }
});

Anybody know what's wrong here?有人知道这里出了什么问题吗? I got this list from official websites.我从官方网站上得到了这个列表。 Note also that the icon is not missing, it's just incorrect.另请注意,图标并没有丢失,只是不正确。

There were some version incompatibilities.有一些版本不兼容。 I fixed it by matching it as:我通过将其匹配为来修复它:

  • jQuery: 3.6.0 jQuery:3.6.0
  • Bootstrap: 4.6.2引导程序:4.6.2
  • Tempus Dominus Bootstrap-4: 5.0.0 Tempus Dominus Bootstrap-4:5.0.0
  • F ont Awesome: 5.1.1 F ont Awesome:5.1.1

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

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