You are here

function commerce_coupon_date_evaluate_date_configure in Commerce Coupon 7.2

Inline conditions configure callback: date range form.

1 string reference to 'commerce_coupon_date_evaluate_date_configure'
commerce_coupon_date_inline_conditions_info in modules/date/commerce_coupon_date.module
Implements hook_inline_conditions_info.

File

modules/date/commerce_coupon_date.module, line 59

Code

function commerce_coupon_date_evaluate_date_configure($settings) {
  if (is_string($settings)) {
    $settings = unserialize($settings);
  }
  $form['start'] = array(
    '#type' => 'date_popup',
    '#title' => t('Start date'),
    '#date_format' => 'm/d/Y',
    '#default_value' => !empty($settings['start']) ? $settings['start'] : '',
    '#element_validate' => array(
      'commerce_coupon_date_range_start_validate',
    ),
  );
  $form['end'] = array(
    '#type' => 'date_popup',
    '#title' => t('End date'),
    '#date_format' => 'm/d/Y',
    '#default_value' => !empty($settings['end']) ? $settings['end'] : '',
  );
  return $form;
}