You are here

function theme_recipe_duration in Recipe 7.2

Returns a string for displaying an integer field as a recipe duration.

1 theme call to theme_recipe_duration()
theme_recipe_summary in ./recipe.module
Returns HTML for displaying the recipe summary box.

File

./recipe.module, line 893
Contains functions for Recipe node CRUD and display.

Code

function theme_recipe_duration($variables) {
  $duration = $variables['duration'];
  $hours = floor($duration / 60);
  $minutes = $duration % 60;
  $output = array();
  if ($hours > 0) {
    $output['hours'] = format_plural($hours, '1 hour', '@count hours');
  }
  if ($minutes > 0 || $duration == 0) {
    $output['minutes'] = format_plural($minutes, '1 minute', '@count minutes');
  }
  return implode(', ', $output);
}