Problem/Motivation
Using the feeds module, I can't seem to get an accurate value into the duration field using the smartdate field type.
I see that there is a Feeds Target Plugin for the smartdate field type, https://git.drupalcode.org/project/smart_date/-/blob/4.0.x/src/Feeds/Tar...
But it only populates value and end_value, and not the rest of the fields which include:
duration
timezone
rrule
rrule index
Proposed resolution
Add the rest of the fields to the feeds target plugin.
Remaining tasks
Add Duration
- Provide calculated default by subtracting start timestamp from end timestamp and divide by 60 to convert to minutes.
Add Timezone
Add RRule
Add RRule index
User interface changes
Additional targets for Feeds

API changes
N/A
Data model changes
N/A
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | Screenshot 2023-04-17 at 12.00.50 PM.png | 132.74 KB | trackleft2 |
| #2 | add-duration-to-feed-importer.diff | 1.1 KB | trackleft2 |
Comments
Comment #2
trackleft2Comment #3
trackleft2Comment #4
trackleft2Comment #5
trackleft2Comment #6
trackleft2Comment #7
trackleft2Comment #8
trackleft2Comment #10
mandclu commentedThanks for identifying this, and for providing a fix. I did alter your solution to apply a
round()function to a calculated duration, to ensure it would save without errors to a field designed to accept integers.As a point of protocol, I should point out that the community-intended path is to provide a patch file instead of a diff, but this was easy enough to apply.
Thanks again!
Comment #12
sportch commentedAny chance this functionality gets added to the Smart Date module so devs don't have to keep patching?
Comment #13
trackleft2This functionality should exist as of https://www.drupal.org/project/smart_date/releases/4.0.0