This website is for yearly renting.
(After the website finished, the field_date_end_rent will be hidden in the node submit form. The form will be automatically filled by Rules.)
(In the Rules example, I'm using Content is viewed for event. Its for testing purposes.)
The field_date_end_rent = field_date_start_rent + field_subscription_period year
Means, If field_date_start_rent is 2012-06-19 10:31:00, and field_subscription_period is 2 year, Rules should fill field_date_end_rent with value 2014-06-19 10:31:00
To see the result, I'm using:
$newdate = strtotime("+2 year","$value");
return $newdate;In order to make Rules automatically fill the form, I need to change +2 year to become +$newvar year,
where $newvar is variable for field_subscription_period
The problem is, I dont know how to use field_subscription_period data or variable in Set data value of field_date_end_rent. There is no field_subscription_period data in Data Selector.
You can test the Drupal 7 installation in the attachment, complete with the example.
username: admin
password: z
| Attachment | Size |
|---|---|
| testd7-201206290208.tar_.gz | 3.69 MB |