Search code examples
jqueryajaxdatepickertimepicker

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!


Solution

  • 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:

    alt text

    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
    });