You are here

function theme_webform_mail_date in Webform 5

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

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

string Textual output to be included in the email.

File

components/date.inc, line 189

Code

function theme_webform_mail_date($data, $component) {
  $output = $component['name'] . ":";
  if ($data['month'] && $data['day']) {
    $timestamp = strtotime($data['month'] . "/" . $data['day'] . "/" . $data['year']);

    /* allow for PHP timezone offset */
    $tz_offset = strtotime(date("M d Y H:i:s")) - strtotime(gmdate("M d Y H:i:s"));
    $timestamp += $tz_offset;
    $output .= " " . format_date($timestamp, "custom", 'F j, Y', NULL);
  }
  return $output;
}