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
User interface changes shown adding more field values to feeds mapping interface.

API changes

N/A

Data model changes

N/A

Comments

trackleft2 created an issue. See original summary.

trackleft2’s picture

Issue summary: View changes
StatusFileSize
new1.1 KB
trackleft2’s picture

Title: Feeds import duration field » Feeds should import more than just start and end dates, duration, timezone, rrule id
trackleft2’s picture

Title: Feeds should import more than just start and end dates, duration, timezone, rrule id » Shoul be able to import duration, timezone, rrule id with feeds module.
trackleft2’s picture

Title: Shoul be able to import duration, timezone, rrule id with feeds module. » Should be able to import duration, timezone, rrule id with feeds module.
trackleft2’s picture

Issue summary: View changes
trackleft2’s picture

Issue summary: View changes
StatusFileSize
new132.74 KB
trackleft2’s picture

Issue summary: View changes

  • mandclu committed e69e5277 on 4.0.x
    Issue #3354696 by trackleft2, mandclu: Should be able to import duration...
mandclu’s picture

Status: Active » Fixed

Thanks 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!

Status: Fixed » Closed (fixed)

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

sportch’s picture

Any chance this functionality gets added to the Smart Date module so devs don't have to keep patching?

trackleft2’s picture

This functionality should exist as of https://www.drupal.org/project/smart_date/releases/4.0.0