Hello, is it please possible to define in the display part something like "If empty, display:" text? I am using views and I would like to display the date, if defined, or something like "undefined", or "not used", "immediately"... different for different nodes...

Thanks, in any case, for this module! B.

Comments

karens’s picture

Status: Active » Fixed

Best way to do this is in the theme:

function theme_date_display_combination($field, $dates, $node = NULL) {
  $date1 = $dates['value']['formatted'];
  $date2 = $dates['value2']['formatted'];
  if (empty($date1) && empty($date2)) {
    return '';
  }
  elseif ($date1 == $date2 || empty($date2)) {
    return '<span class="date-display-single">'. $date1 .'</span>';
  }
  else {
    return '<span class="date-display-start">'. $date1 .'</span><span class="date-display-separator"> - </span><span class="date-display-end">'. $date2 .'</span>';
  }
}

Override that in your own theme by copying it and renaming it with your own theme's name, then alter the way that 'empty' values are displayed.

SpatnyNick’s picture

yes this is the way I am using now. thank you anyway!

dries’s picture

Status: Fixed » Closed (fixed)