如何在beforeShowDay中突出显示一个对象

时间:2018-04-26 07:44:13

标签: javascript jquery datepicker jquery-ui-datepicker

我如何 beforeShowDay 突出显示对象中的值?

  1. jquery datepicker
  2. beforeShowDay: function(date) {
      var date = $("#calendar").datepicker({
        dateFormat: 'yy-mm-dd'
      }).val();
      var date = highdate;
      console.log(highdate);
      console.log(hightext);
      var Highlight = highdate[date];
      var HighlighText = hightext[date];
      if (Highlight) {
        return [true, "Highlighted", HighlighText];
      } else {
        return [true, '', ''];
      }
    }
    

    2.highdate Objects

    Object
    0:"2018-04-04"
    1:"2018-04-30"
    __proto__:Object
    

    3.hightext Objects

    Object
    0:"text1"
    1:"text2"
    __proto__:Object
    

    4.css

    .Highlighted a {
      background-color: Green !important;
      background-image: none !important;
      color: White !important;
      font-weight: bold !important;
      font-size: 12pt;
    }
    

0 个答案:

没有答案