You are here

function _partial_date_component_separator in Partial Date 7

Returns any configured separators for two components.

1 call to _partial_date_component_separator()
partial_date_format in ./partial_date.module

File

./partial_date.module, line 1484
Defines a date element that allows for any combination of date granularity settings.

Code

function _partial_date_component_separator($a, $b, $separators = array()) {
  if ($a === FALSE) {
    return;
  }
  $a_type = _partial_date_component_type($a);
  $b_type = _partial_date_component_type($b);
  if (!$a_type || !$b_type) {
    $key = 'other';
  }
  elseif ($a_type == $b_type) {
    $key = $a_type;
  }
  else {
    $key = 'datetime';
  }
  return isset($separators[$key]) ? $separators[$key] : FALSE;
}