Current date in a field

Created on 7 February 2024, 5 months ago
Updated 21 February 2024, 4 months ago

Hello,

I have a feed that imports items every 1 hour.
As it creates a large amount of items (24 by day) I would like to keep only the last item every day.
The best way is to create a date only field and to mark it as unique, so that the feed should update one item every hour and create a new one the next day.

Is there any way to do that ?

I tried to use tamper to set the date only field (format Y-M-D) from Timestamp to date but the website hangs with this error:

Drupal\tamper\Exception\TamperException : Input should be numeric. dans Drupal\tamper\Plugin\Tamper\TimeToDate->tamper() (ligne 62 de /web/modules/contrib/tamper/src/Plugin/Tamper/TimeToDate.php).

Thanks

πŸ’¬ Support request
Status

Fixed

Version

2.0

Component

Miscellaneous

Created by

πŸ‡§πŸ‡ͺBelgium jbfelix

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

Comments & Activities

  • Issue created by @jbfelix
  • Status changed to Fixed 5 months ago
  • πŸ‡³πŸ‡±Netherlands MegaChriz

    What value does Feeds Tamper receive? The Tamper plugin "Timestamp to date" expects to receive numerical input. It doesn't set a number by itself.

    If the source does not provide a value for it, I think these three Tamper plugins could make it work (in this order):

    1. Set value or default value: "Value" set to "now".
    2. String to Unix Timestamp
    3. Timestamp to date

    Assuming this fixes your issue, I mark this issue as "fixed". If it is not fixed, feel free to reopen this issue.

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

Production build 0.69.0 2024