You are here

function DateRepeatFormTest::formatDateForRRULEInputs in Date 8

1 call to DateRepeatFormTest::formatDateForRRULEInputs()
DateRepeatFormTest::dateForm in date_repeat/lib/Drupal/date_repeat/Tests/DateRepeatFormTest.php

File

date_repeat/lib/Drupal/date_repeat/Tests/DateRepeatFormTest.php, line 511
Test Date Repeat form.

Class

DateRepeatFormTest

Namespace

Drupal\date_repeat\Tests

Code

function formatDateForRRULEInputs($form_field_name, $date_widget_type, $date) {
  $return = array();
  switch ($date_widget_type) {
    case 'select':
      $return["{$form_field_name}[datetime][year]"] = $date['year'];
      $return["{$form_field_name}[datetime][month]"] = $date['month'];
      $return["{$form_field_name}[datetime][day]"] = ltrim($date['day'], '0');
      break;
    case 'text':
    case 'popup':

      //$return["{$field_name}[datetime][date]"] = '2011-10-07';
      $return["{$form_field_name}[datetime][date]"] = "{$date['year']}-{$date['month']}-{$date['day']}";
      break;
  }
  return $return;
}