简体   繁体   English

如何在 Bootstrap datetimepicker 上添加过去日期的工具提示文本?

[英]How can I add the tooltip text for the Past Dates on Bootstrap datetimepicker?

I'm using Bootstrap datetimepicker to select the Date in which all the Past Dates are Disabled .我正在使用Bootstrap datetimepicker到 select the Date in which all the Past Dates are Disabled When the user tries to Hover over any Past date, I need to display tooltip "Choose any future Date".当用户尝试在过去的任何日期Hover时,我需要显示工具提示“选择任何未来日期”。

I'm using bootstrap-datetimejs version 4.17.47我正在使用bootstrap-datetimejs版本4.17.47

I've tried this hover function `我试过这个 hover function `


$("#orderdatepicker").click(function() {  
  $(".bootstrap-datetimepicker-widget tr").hover(
      function() {
        console.log('in....');
        console.log('this...', this);
      },
      function() {
        console.log('out....');
      }
    );
  });

I could see the console logs, but this log is only returning the empty tr .我可以看到控制台日志,但日志仅返回空tr Is there any way for getting the Date that the user is trying to select to perform an operation on it?有什么方法可以获取用户尝试对 select 执行操作的Date吗?

The selector you are looking for is:您正在寻找的选择器是:

.bootstrap-datetimepicker-widget table td .disabled

Instead of the: $(".bootstrap-datetimepicker-widget tr")而不是: $(".bootstrap-datetimepicker-widget tr")

It would be: $(".bootstrap-datetimepicker-widget.disabled")它将是: $(".bootstrap-datetimepicker-widget.disabled")

Now these are the 3 different elements that can be disabled, if your weekday letters also return something then try one of the following too:现在,这些是可以禁用的 3 个不同元素,如果您的工作日信件也返回了一些内容,那么也可以尝试以下操作之一:

.bootstrap-datetimepicker-widget table td .disabled

.bootstrap-datetimepicker-widget table td.disabled

I don't know which variation and configuration you have, you really should put more info in your questions to get answers much faster.我不知道你有哪种变体和配置,你真的应该在你的问题中输入更多信息以便更快地获得答案。 You didn't even share your configuration and initiation function.你甚至没有分享你的配置和启动 function。

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

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