Currently date offsets in days/months/years are not properly supported, as internally date offsets are always applied in seconds. However the number of seconds of a day (due to DST), a month and a year varies. Because of that we'll have to build in specific support for applying offsets of e.g. 1 month.

Files: 
CommentFileSizeAuthor
#3 rules_date_offset_modify_5_2.patch652 bytesmh86
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch rules_date_offset_modify_5_2.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Comments

Component:Rules Core» Rules Engine
Status:Active» Fixed

implemented: http://drupalcode.org/project/rules.git/commit/ff728b9

As the entity api specifies that durations have to be represented in seconds, we cannot really change the storage format of duration and properly differentiate between e.g. 86400 * 30 seconds or "1 month". However, usually 1 month will be the desired duration so we'll just go with the higher units (years, months, days) if the number of (stored) seconds is high enough. For that I've baked in the assumption that 1 day == 24hours, 1 month == 30 days and 1 year == 12 months.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Status:Closed (fixed)» Needs review
StatusFileSize
new652 bytes
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch rules_date_offset_modify_5_2.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Unfortunately the changes do not work in PHP 5.2, as there the date modify function returns NULL instead of the DateTime object (see http://www.php.net/manual/en/datetime.modify.php), leading to a PHP error in 5.2.

Attached patch fixes the code for PHP versions prior to 5.3

Status:Needs review» Fixed

thanks, committed.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.