简体   繁体   English

jQuery Datepick(Keith Wood)用CSS类突出显示defaultDate

[英]jQuery Datepick (Keith Wood) highlight defaultDate with a CSS-class

I am using the inline version of Keith Woods jquery datepick plugin. 我正在使用Keith Woods jquery datepick插件的内联版本。 The default value for the picker is set like this: 选择器的默认值设置如下:

var dpInputField = $('input#datepicker-value');
var defaultDate = (dpInputField.val() == '') ? '1399593600' : dpInputField.val(); // 1399593600 = 9th May 2014 00:00:00

    $('#datepicker').datepick({
      dateFormat: $.datepick.TIMESTAMP,
      monthsToShow: 2,
      changeMonth: false,
      altField: '#datepicker-value',
      onDate: showDayAndMonth,
      defaultDate: defaultDate,
    }, $.extend($.datepick.regional[window.language]));

Theres a form submit after selecting a date. 选择日期后提交表单。 If I debug the defaultDate its correct! 如果我调试defaultDate正确的话! Just a CSS-class is missing somehow. 只是缺少CSS类。

Solved it. 解决了。 I am using the onShow: event to call a function which is selecting the HTML object by its class. 我正在使用onShow:事件来调用一个按其类选择HTML对象的函数。

for example: class="dp1403344800000", as theres the timestamp as part of the css class, it was no problem to .addClass(datepicker-selected) 例如:class =“ dp1403344800000”,因为时间戳是css类的一部分,所以.addClass(datepicker-selected)没问题

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

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