diff --git a/core/modules/datetime/datetime.views.inc b/core/modules/datetime/datetime.views.inc index ec6512e..dbb4c59 100644 --- a/core/modules/datetime/datetime.views.inc +++ b/core/modules/datetime/datetime.views.inc @@ -15,6 +15,24 @@ function datetime_field_views_data(FieldStorageConfigInterface $field_storage) { foreach ($data as $table_name => $table_data) { // Set the 'datetime' filter type. $data[$table_name][$field_storage->getName() . '_value']['filter']['id'] = 'datetime'; + + // Set the 'datetime' argument type. + $data[$table_name][$field_storage->getName() . '_value']['argument']['id'] = 'datetime'; + + // Create year, month, and day arguments. + $group = $data[$table_name][$field_storage->getName() . '_value']['group']; + foreach (array('year', 'month', 'day') as $argument_type) { + $data[$table_name][$field_storage->getName() . '_value_' . $argument_type] = array( + 'title' => $field_storage->getLabel() . ' (' . $argument_type . ')', + 'help' => t('Date in the form of YYYY.'), + 'argument' => array( + 'field' => $field_storage->getName() . '_value', + 'id' => 'datetime_' . $argument_type, + ), + 'group' => $group, + ); + } } + return $data; } \ No newline at end of file diff --git a/core/modules/datetime/src/Plugin/views/argument/Date.php b/core/modules/datetime/src/Plugin/views/argument/Date.php new file mode 100644 index 0000000..3615bad --- /dev/null +++ b/core/modules/datetime/src/Plugin/views/argument/Date.php @@ -0,0 +1,35 @@ +tableAlias.$this->realField"; + } +} \ No newline at end of file diff --git a/core/modules/datetime/src/Plugin/views/argument/DayDate.php b/core/modules/datetime/src/Plugin/views/argument/DayDate.php new file mode 100644 index 0000000..17d5cbd --- /dev/null +++ b/core/modules/datetime/src/Plugin/views/argument/DayDate.php @@ -0,0 +1,22 @@ +