function _calendar_systems_fix_by_granularity in Calendar Systems 7
Same name and namespace in other branches
- 8 calendar_systems.helpers.inc \_calendar_systems_fix_by_granularity()
- 6.3 calendar_systems.module \_calendar_systems_fix_by_granularity()
- 6 calendar_systems.module \_calendar_systems_fix_by_granularity()
- 7.3 calendar_systems.module \_calendar_systems_fix_by_granularity()
- 7.2 calendar_systems.helpers.inc \_calendar_systems_fix_by_granularity()
Helper function
Parameters
$format:
$granularity:
Return value
string
1 call to _calendar_systems_fix_by_granularity()
- _calendar_systems_get_format in ./calendar_systems.helpers.inc 
- Helper function
File
- ./calendar_systems.helpers.inc, line 254 
Code
function _calendar_systems_fix_by_granularity($format, $granularity) {
  $new_format = '';
  $list = _calendar_systems_get_date_format();
  for ($i = 0; $i < strlen($format); $i++) {
    $c = $format[$i];
    if (isset($list[$c])) {
      if (isset($granularity[$list[$c]])) {
        $new_format .= $c;
      }
    }
    else {
      $new_format .= $c;
    }
  }
  return $new_format;
}