Thanx – the only two snippetts I have with date sin them are:
add_filter(‘frm_validate_field_entry’, ‘set_my_expiration_date’, 10, 3);
function set_my_expiration_date($errors, $posted_field, $posted_value){
if ( $posted_field->id == 929 ) { //change 929 to the ID of the date field to change
// Get the first date in a UNIX timestamp
$first_date = date_create_from_format( ‘Y/m/d’, $_POST[‘item_meta’][892] ); //Change 892 to the ID of the first date field
$first_date = date_format( $first_date, ‘Y-m-d’ );
$first_date = strtotime( $first_date );
// Get the final date in Y-m-d format
$final_date = strtotime(‘+1095 day’, $first_date);
$final_date = date(‘Y-m-d’, $final_date);
// Save the final date as the posted value
$_POST[‘item_meta’][$posted_field->id] = $final_date;
}
return $errors;
}
AND
add_filter(‘frm_validate_field_entry’, ‘set_wm_expiration_date’, 10, 3);
function set_wm_expiration_date($errors, $posted_field, $posted_value){
if ( $posted_field->id == 4444 ) { //change 4444 to the ID of the date field to change
// Get the first date in a UNIX timestamp
$first_date = date_create_from_format( ‘Y/m/d’, $_POST[‘item_meta’][4443] ); //Change 4443 to the ID of the first date field
$first_date = date_format( $first_date, ‘Y-m-d’ );
$first_date = strtotime( $first_date );
// Get the final date in Y-m-d format
$final_date = strtotime(‘+1095 day’, $first_date);
$final_date = date(‘Y-m-d’, $final_date);
// Save the final date as the posted value
$_POST[‘item_meta’][$posted_field->id] = $final_date;
}
return $errors;
}