HI there,
I'm trying to use the gform_pre_submission hook to convert a date field into a different format.
I'm using the following:
add_action("gform_pre_submission", "pre_submission_handler", 10, 2);
function pre_submission_handler($form){
date_default_timezone_set('UTC');
$date = $_POST["input_4"];
$date = date('l jS M', strtotime($date));
$_POST["input_4"] = $date;
die(var_dump($_POST));
}
When I perform a vardump of the $_POST variable it gives the right info:
["input_4"]=> string(17) "Saturday 29th Jun"
but it doesn't seem to save it. In the entries page the Date column is left blank.
Any thoughts?