gpt4 book ai didi

内联日期选择器中的 jQuery UI beforeShowDay 崩溃

转载 作者:行者123 更新时间:2023-12-01 08:13:38 25 4
gpt4 key购买 nike

相当直接的问题:

如果我有一个内联日期选择器(在 div 上调用 .datepicker() 而不是输入)并使用 beforeShowDay 函数,则一切都会中断。

我在这里创建了一个 jsFiddle 以便您可以测试它: http://jsfiddle.net/MBwSe/1/

beforeShowDay 函数对我来说在前 4 天(2012 年 7 月 29 日到 8 月 1 日)有效,然后在 2012 年 8 月 2 日中断并出现以下错误:

TypeError: daySettings is undefined
[Break On This Error]
line 8827

var unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] ||

有什么想法吗?让我发疯!

最佳答案

您必须从 beforeShowDay 返回一个数组。来自文档:

The function takes a date as a parameter and must return an array with [0] equal to true/false indicating whether or not this date is selectable, [1] equal to a CSS class name(s) or "" for the default presentation, and [2] an optional popup tooltip for this date. It is called for each day in the datepicker before it is displayed.

修改后的 fiddle : http://jsfiddle.net/MBwSe/2/

关于内联日期选择器中的 jQuery UI beforeShowDay 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12064606/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com