Chris@0: $table_data) { Chris@0: // Set the 'datetime' filter type. Chris@0: $data[$table_name][$field_storage->getName() . '_value']['filter']['id'] = 'datetime'; Chris@0: Chris@0: // Set the 'datetime' argument type. Chris@0: $data[$table_name][$field_storage->getName() . '_value']['argument']['id'] = 'datetime'; Chris@0: Chris@0: // Create year, month, and day arguments. Chris@0: $group = $data[$table_name][$field_storage->getName() . '_value']['group']; Chris@0: $arguments = [ Chris@0: // Argument type => help text. Chris@0: 'year' => t('Date in the form of YYYY.'), Chris@0: 'month' => t('Date in the form of MM (01 - 12).'), Chris@0: 'day' => t('Date in the form of DD (01 - 31).'), Chris@0: 'week' => t('Date in the form of WW (01 - 53).'), Chris@0: 'year_month' => t('Date in the form of YYYYMM.'), Chris@0: 'full_date' => t('Date in the form of CCYYMMDD.'), Chris@0: ]; Chris@0: foreach ($arguments as $argument_type => $help_text) { Chris@0: $data[$table_name][$field_storage->getName() . '_value_' . $argument_type] = [ Chris@0: 'title' => $field_storage->getLabel() . ' (' . $argument_type . ')', Chris@0: 'help' => $help_text, Chris@0: 'argument' => [ Chris@0: 'field' => $field_storage->getName() . '_value', Chris@0: 'id' => 'datetime_' . $argument_type, Chris@0: ], Chris@0: 'group' => $group, Chris@0: ]; Chris@0: } Chris@0: Chris@0: // Set the 'datetime' sort handler. Chris@0: $data[$table_name][$field_storage->getName() . '_value']['sort']['id'] = 'datetime'; Chris@0: } Chris@0: Chris@0: return $data; Chris@0: }