Suggestions for jQuery-based Date/Time Selector
I'm in search for a jQuery-based Date/Time Selector. I have found a few that are quite nice, but one of my requirements is that I can provide a json/xml/etc source of available days/开发者_开发问答times and the control should only allow selections of available days/times.
Is anyone aware of a plugin that does this, or at least a plugin that could be modified to do this?
Thanks!
I use jQuery UI's datepicker in conjunction with a plugin from Martin Milesich. It's a fantastic way to implement timepicking right next to the datepicking. It looks like the plugin has gone offline, but I uploaded the script so you can download it here: http://textsnip.com/19046f
Here is a screenshot:
It's very easy to implement. Just call the regular datepicker()
method from jQuery UI and add a showTime: true
parameter. Here is a sample:
$('#sample').datepicker({
duration: '',
showTime: true,
constrainInput: false,
stepMinutes: 1,
stepHours: 1,
altTimeField: '',
time24h: false
});
This plugin is pretty good and it should satisfy your requirements.
http://keith-wood.name/datepickRef.html
Notice onDate
method: it allows you to control presentation of each particular date, including whether date is selectable or not.
精彩评论