Download & Extend

Easy way to make days unselectable

Project:Date
Version:6.x-2.x-dev
Component:Date Popup
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (duplicate)

Issue Summary

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

#1

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.

#2

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

#3

Status:active» closed (duplicate)

Duplicate of #625264: Improvements to date_popup module