You are here

function _webform_submit_time in Webform 7.4

Same name and namespace in other branches
  1. 6.3 components/time.inc \_webform_submit_time()
  2. 7.3 components/time.inc \_webform_submit_time()

Implements _webform_submit_component().

File

components/time.inc, line 357
Webform module time component.

Code

function _webform_submit_time($component, $value) {

  // Convert to 24-hour time before string conversion.
  if ($component['extra']['hourformat'] == '12-hour') {
    $value = webform_time_convert($value, '24-hour');
  }

  // Convert the value into a ISO 8601 string.
  return $value['hour'] !== '' ? webform_date_string($value, 'time') : '';
}