private function DateRestrictionsHostEntityMinMaxTestCase::setHostEntityDate in Date Restrictions 7
Fills edit array with keys for the host entity date field.
2 calls to DateRestrictionsHostEntityMinMaxTestCase::setHostEntityDate()
File
- modules/
minmax/ tests/ date_restrictions_minmax_host_entity.test, line 196  - Tests for date_restrictions_minmax.module.
 
Class
- DateRestrictionsHostEntityMinMaxTestCase
 - Tests for host_entity based relative/fixed minmax restrictions.
 
Code
private function setHostEntityDate($date, $edit = array()) {
  $format = date_limit_format($this->date_input_format, array(
    'year',
    'month',
    'day',
  ));
  $edit['field_host_entity_date[und][0][value][date]'] = $date
    ->format($format);
  $format = date_limit_format($this->date_input_format, array(
    'hour',
    'minute',
  ));
  $edit['field_host_entity_date[und][0][value][time]'] = $date
    ->format($format);
  return $edit;
}