diff --git a/booking.reports.inc b/booking.reports.inc index 1844f31..17e123d 100644 --- a/booking.reports.inc +++ b/booking.reports.inc @@ -372,6 +372,9 @@ function booking_csv_report() { if (in_array($key, $fields_to_skip)) continue; $header_array[] = $key; + //add in a special column for a processed version of the date of birth + if (strcmp($key,"booking_dob") == 0) + $header_array[] = "booking_dob_processed"; } $header = implode( $delimiter, $header_array ); @@ -396,10 +399,15 @@ function booking_csv_report() { } //handle dates - if ($key == 'booking_dob' || $key == 'booking_passport_expiry_date') { + if ($key == 'booking_dob') { $output[] = format_date($value, 'custom', 'd/m/Y'); + $output[] = '"' . _booking_avg_age($value, 1, $event->booking_event_start) . '"'; continue; } + if ($key == 'booking_passport_expiry_date') { + $output[] = format_date($value, 'custom', 'd/m/Y'); + continue; + } //handle more exact dates if ($key == 'booking_timestamp') {