开发者

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:

Suggestions for jQuery-based Date/Time Selector

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜