In Gravity Forms plugin I’ve tried to dynamically populate End Date and End Time based on the Start Date and Start Time values.
This is the code I used to dynamically populate End Date:
[php]add_filter(“gform_field_value_date”, “populate_date”);
function populate_date($value){
return date(‘Y-m-d’, strtotime(’+0 days’));
}[/php]
This actually works but it adds ‘+0 days’ to the submission date and not to the ‘Start Date’ value.
Same goes with time. I want to have the ‘End Time’ field auto-populated, i.e. End Time = Start Time. And I want to add “+1 hour” to the ‘Start Time’ and thus get ‘End Time’.
Any suggestions? Tnx