Jason Palmer
Jason Palmer

Reputation: 731

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!

Upvotes: 1

Views: 1407

Answers (2)

James Skidmore
James Skidmore

Reputation: 50328

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

Upvotes: 2

Nikita Rybak
Nikita Rybak

Reputation: 68016

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.

Upvotes: 0

Related Questions