How to determine the future date value in a 3-year rhythm

Created on 18 April 2024, 8 months ago
Updated 1 August 2024, 5 months ago

Problem/Motivation

Starting from a date field value that lies in the past (field_startdate), I want to determine the next date value that is in a 3-year cycle to this start date an lies in the future (next_3year_date)?
The two date fields are custom date fields in a node entity.

What is the easiest way to calculate this date value with ECA in order to insert it into another date field?

Example:

Start date: 01.03.2017

Date data in 3-year intervals are:
01.03.2020 (past as seen from today)
01.03.2023 (past as seen from today)
01.03.2026 (future as seen from today) --> this is the correct value I want to set.

I know that calculations with dates can be performed with eta_tamper but I don't get how to set up the operations to determine the date value.

I hope this is not out of scope and a solution may help others too.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

💬 Support request
Status

Closed: outdated

Version

1.1

Component

Miscellaneous

Created by

🇩🇪Germany marco.b

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

Comments & Activities

  • Issue created by @marco.b
  • 🇩🇪Germany jurgenhaas Gottmadingen

    This sounds like a task for ECA Tamper. There are action plugins to convert between Unix timestamps and formatted dates. And there is also a requested new tamper plugin at Time offset tamper Needs work that lets you calculate time offsets (e.g. timestamp +3years). In combination of all those, you should be able to do what you described.

  • 🇩🇪Germany marco.b

    Thank you. I imagine the requested new tamper plugin could help here. I will try out.

  • Status changed to Postponed: needs info 8 months ago
  • 🇩🇪Germany jurgenhaas Gottmadingen
  • 🇩🇪Germany marco.b

    It has turned out that the requirements in the related web project have changed and this calculation has now become obsolete. Nevertheless, I would like to see this problem solved out of interest in further training and also for the community.

    In principle, the modelling approach would be as follows:
    Add 3 years to the field_startdate and compare with current_date. If the result date is smaller (older) than the current_date, repeat this operation until the result date is in the future.
    The eca_tamper plugin must be used to convert between Unix timestamps and formatted dates.

    Unfortunately, I don't have the time this week to build the ECA-Moidel. The maintainers may therefore feel free to close this issue.

  • Status changed to Closed: outdated 5 months ago
  • 🇩🇪Germany jurgenhaas Gottmadingen
Production build 0.71.5 2024