This patch appears to work for me.

What I like about it is that it just leverages Date API's function for determining the all-day-ishness of a start/end date pair (for the moment at least, Date doesn't set an explicit flag anywhere) so if their definition ever changes we're still fine.

What I don't like is the kludginess of temporarily setting hour granularity to fool feedsDateTime::setTimezone() into doing what we want, but as I'm not very familiar with Feeds (and OOP is outside my comfort zone), I didn't want to introduce any new properties or methods, or change existing ones. Neater solutions most welcome.

CommentFileSizeAuthor
feeds-date_all_day.patch2.51 KBMatthew Davidson

Issue fork feeds-1665056

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rolfmeijer’s picture

As date_all_day is not saved in the database but calculated it is also possible to use Feeds Tamper and set the time for both the start and end date to 00:00 (GMT, take timezone conversion into consideration here). In that case the dates will automatically be set to “All day”.

Status: Needs review » Needs work

The last submitted patch, feeds-date_all_day.patch, failed testing.

lwalley’s picture

Date 7.x-3.x branch now saves all day flag to database #3202962: Expand field specification with new element for "all day" and has removed the "magic" is all day logic that was based on time, so this patch probably will no longer work for Date 7.x-3.x.

Perhaps a couple of options for supporting all day in feeds:

  1. add an explicit mapping option for all day
  2. programmatically set all day based on absence of time or time ranges i.e. re-introduce some "magic" logic, however note the rationale for date module maintainers switching to an explicit flag appears to have been because the magic logic was problematic.

lwalley’s picture

Status: Needs work » Needs review

Added PR to include basic support for targeting date module's new 'all_day' column introduced in 7.x-3.x branch. Assumes source values are boolean-like i.e. supports source strings "yes", "no", "on", "off", "true", "false", ""; boolean values true, false; integers 0 (false), any non-zero integer (true), and; null (false).