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.
Comment | File | Size | Author |
---|---|---|---|
feeds-date_all_day.patch | 2.51 KB | Matthew Davidson | |
Issue fork feeds-1665056
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:
Comments
Comment #1
rolfmeijer CreditAttribution: rolfmeijer commentedAs 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”.
Comment #3
lwalley CreditAttribution: lwalley commentedDate 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:
Comment #5
lwalley CreditAttribution: lwalley commentedAdded 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).