You are here

function theme_webform_mail_time in Webform 5

Same name and namespace in other branches
  1. 5.2 components/time.inc \theme_webform_mail_time()
  2. 6.2 components/time.inc \theme_webform_mail_time()

Format the output of emailed data for this component

Parameters

$data: A string or array of the submitted data

$component: An array of information describing the component, directly correlating to the webform_component database schema.

Return value

Textual output to be included in the email.

File

components/time.inc, line 185

Code

function theme_webform_mail_time($data, $component) {
  $output = $component['name'] . ":";
  if ($data['hour'] && $data['minute']) {
    if ($component['extra']['hourformat'] == "24-hour") {
      $output .= " " . $data['hour'] . ":" . $data['minute'];
    }
    else {
      $output .= " " . $data['hour'] . ":" . $data['minute'] . " " . $data['ampm'];
    }
  }
  return $output;
}