0
我有一個對象數組,什麼是確定日期是否在數組中,以便它不能在jQuery日期選擇器中選擇的最佳方法是什麼。如果需要,我可以將DateValue存儲爲日期。使用beforeShowDay和對象數組排除日期在jQuery datepicker
var EventDates = [{"DateID: "1", DateValue: "3/1/2011", FormattedDate: Tue, Mar 1 2011"},
{"DateID: "2", DateValue: "3/2/2011", FormattedDate: Wed, Mar 2 2011"}]
$('.juidateicon_ext').datepicker({
showOn: "button",
buttonImage: "/Content/images/icons/calendar.gif",
buttonImageOnly: true,
showOn: 'both',
beforeShowDay: eventDays
});
function eventDays(date) {
1. Code to determine if "date" is in DateValue in the EventDates Array
2. If date exist, return [false, ""];else return [true, ""];
}
工作完美。謝謝,你爲我節省了一些時間。 – scottrakes 2011-03-02 13:59:29
@scottrakes:沒問題,樂意幫忙。 – 2011-03-02 14:06:50