Searching for a custom date picker
I sure do love jQuery. It has some great date pickers available for it. But I'm looking for something a bit more custom and don't know how to program it. If you've got a suggestion for me, I'd greatly appreciate it.
It would have two requ开发者_StackOverflowirements:
- The date selected would always be three days out from the current date.
- Weekends (U.S./Saturday and Sunday) wouldn't be available. Weekdays only.
I guess that's it. I stand on the shoulders of giants. Thanks for any help you can give in advance.
Actually you can do this with jQuery UI's Datepicker.
You'd need something like this:
$("#your_date_input").datepicker({
minDate: -3,
maxDate: 3,
beforeShowDay: $.datepicker.noWeekends
});
This will make those weekdays selectable that are 3 days from today (into past and future as well). If you need something more complex, it is easy to write your own beforeShowDay
function, check the documentation. There are also lots of jQuery UI Datepicker questions here on StackOverflow, so you can easily get help.
No need to reinvent the wheel, if we have great tools available.
You can create a custom Jquery datepicker like this: http://www.share-your-experiences.com/viewtopic.jbb?t=16&Create-a-custom-jquery-datepicker-in-your-language
精彩评论