A common use-case is to display a view of nodes with date fields and show the time hence for the end date only (and not the start date). Currently this is not possible, as any "time hence" selection in the views field configuration will always show "time hence" relation between now and the start date. There does not seem to be a way to show time hence/ago from the end date.

Please correct me if there is a way to do this, or if this issue is a duplicate.

Comments

brodhagen’s picture

https://drupal.org/node/2026545

This patch worked for displaying time ago from the End Date.

marksmith’s picture

This is still a problem in the 7.x-2.10 version. Checking the "Use the End date, instead of the start date" does not work.

marksmith’s picture

For those looking for a solution, the node mentioned by #brodhagen provided the necessary patch to the date module (see comment #9). The patch was essentially applied to version 7.x-2.10 of the module, except for the date.theme file:

diff --git a/date.theme b/date.theme
old mode 100755
new mode 100644
index 5cec8b4..7e29405
--- a/date.theme
+++ b/date.theme
@@ -378,6 +378,8 @@ function theme_date_display_interval($variables) {
     'end_date' => $dates['value2']['local']['object'],
     'interval' => $options['interval'],
     'interval_display' => $options['interval_display'],
+    'use_end_date' => !empty($options['use_end_date']) ?
+      $options['use_end_date'] : FALSE,
   );
 
   if ($return = theme('date_time_ago', $time_ago_vars)) {

It works as expected after making these changes.

marksmith’s picture

Category: Feature request » Bug report
marksmith’s picture

Solution not working, if Aggregation is used in views!