Date offset is incorrect

Created on 7 February 2023, almost 2 years ago
Updated 8 February 2023, almost 2 years ago

Date offset is incorrect.

For example, we set a given date + 30 days, then the result will not be 30 days later, but on the same day of the next month. Regardless of whether it is February (28 days) or March (31 days).

If we set 40 days or another offset, this is still the case. He doesn't count days.

I tried to enter 30 days per hour, just to see if the setting of the day is wrong, but then it converts it to days and it is still wrong.

Has this not bothered anyone so far? In the case of a shift to a February date, this is an error of several days!

πŸ› Bug report
Status

Closed: duplicate

Version

2.13

Component

Rules Core

Created by

πŸ‡­πŸ‡ΊHungary atomi

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @atomi
  • Status changed to Closed: duplicate almost 2 years ago
  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

    Has this not bothered anyone so far?

    Yes, this has been raised once or twice before. See for example πŸ› Dates are poorly handled Active
    But no one has been bothered about it enough to contribute a patch or even comment on that issue.

    D7 is quite old at this point. I would be happy to commit a patch as long as it is accompanied by test cases and takes care not to break existing sites that use this feature. But I'm not going to work on it myself.

    I'm marking this as a duplicate of πŸ› Dates are poorly handled Active - please contribute in that issue.

  • πŸ‡­πŸ‡ΊHungary atomi

    I undertake the testing.

    I can't fix the module because I can't program in PHP and I don't know how to create a Drupal module, yet.

    I don't understand that it didn't bother others, since there can be many cases when it is important.
    For example, if I want to hide a content 30 days after a given date, then it doesn't matter how many +/- days have passed due to the error, if that content is related to a subscription.

  • πŸ‡­πŸ‡ΊHungary atomi

    Workaround:

    Another feature of Rules, which also includes offset, counts well. This is interesting, because I think the module takes this action from the same place, but according to them, it doesn't?

    So this solves the problem, avoiding the date offset error:

    Action: Calculate a value

Production build 0.71.5 2024