function _webform_csv_data_date in Webform 6.2
Same name and namespace in other branches
- 5.2 components/date.inc \_webform_csv_data_date()
- 5 components/date.inc \_webform_csv_data_date()
- 6.3 components/date.inc \_webform_csv_data_date()
- 7.4 components/date.inc \_webform_csv_data_date()
- 7.3 components/date.inc \_webform_csv_data_date()
Return the result of a textfield submission. The output of this function will be displayed under the "results" tab then "submissions".
Parameters
$data: An array of information containing the submission result, directly correlating to the webform_submitted_data database schema.
Return value
Textual output formatted for CSV, not including either prefixed or trailing commas.
File
- components/
date.inc, line 439 - Webform module date component.
Code
function _webform_csv_data_date($data) {
if (drupal_strlen($data['value']['0']) > 0 && drupal_strlen($data['value']['1']) > 0 && drupal_strlen($data['value']['2']) > 0) {
$timestamp = strtotime($data['value']['0'] . '/' . $data['value']['1'] . '/' . $data['value']['2']);
$format = webform_date_format('short');
return date($format, $timestamp);
}
else {
return '';
}
}