Datepicker: minDate and maxDate

Public
</> CopyGet raw version
php
  1. <?php
  2. function MODULE_date_popup_process_alter(&$element, &$form_state, &$context) {
  3. if (isset($element['#field']['field_name'])) {
  4. switch ($element['#field']['field_name']) {
  5. case 'field_fact_periode': {
  6. $element['#datepicker_options'] = array(
  7. 'minDate' => "+3D",
  8. );
  9. $element['date'] = date_popup_process_date_part($element);
  10. }
  11. break;
  12. }
  13. }
  14. }
  15. ?>