I would like to be able to use the date popup for scheduling purposes. But to be really effective, there needs to be a way to make specific days unselectable.

I can see that there apparently is a way to make days unselectable on the js side:
http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerCus...

Has there been any thought to adding this to the date API, so Drupal developers could use our familiar php and drupal practices to make certain dates unselectable?

I am thinking just another FAPI parameter:

  $form['date'] = array(
    '#type' => 'date_popup':
    '#title => t('My Date'),
    '#unselectable' => array('mymodule_unselectable_dates'), 
  );

That would be great.

But if there is any other solution/hack/idea, I would appreciate knowing how anyone got it to work. I think there could possibly be a number of applications for this kind of functionality.

Comments

Jorrit’s picture

I have created a patch that adds this functionality. Because more issues request this, I've created a separate issue at #625264: Improvements to date_popup module. I would be very happy if you could take a look at it.

aaustin’s picture

That patch works great. Exactly what I was looking for.

arlinsandbulte’s picture

Status: Active » Closed (duplicate)