Version 1
[yaffs-website] / web / core / modules / views / src / Plugin / views / argument / WeekDate.php
diff --git a/web/core/modules/views/src/Plugin/views/argument/WeekDate.php b/web/core/modules/views/src/Plugin/views/argument/WeekDate.php
new file mode 100644 (file)
index 0000000..918cfec
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+
+namespace Drupal\views\Plugin\views\argument;
+
+/**
+ * Argument handler for a week.
+ *
+ * @ViewsArgument("date_week")
+ */
+class WeekDate extends Date {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected $argFormat = 'W';
+
+  /**
+   * Provide a link to the next level of the view
+   */
+  public function summaryName($data) {
+    $created = $data->{$this->name_alias};
+    return $this->t('Week @week', ['@week' => $created]);
+  }
+
+}