Problem/Motivation
This is a follow-up to #3196428: Migrate from standard date field in Drupal 7 to Recurring Events, where migration plugins were introduced.
I think the timezone adjustments are not quite correct, and here is why.
Let's take a look into this example:
$start_event = new DrupalDateTime($first['value'], DateTimeItemInterface::STORAGE_TIMEZONE);
$start_event->setTimezone($source_timezone);
In the first line we pass a date and clarify it's in UTC timezone, which is already not the case. The destination plugin accepts a dedicated setting with source timezone, which should be used here.
In the second line, it's not just changing the timezone, it's also updating the date accordingly. For example, if source timezone is America/Los_Angeles, it'll make -7 hours.
Proposed resolution
I'm not 100% sure, but the following steps seem more reasonable:
1) Clarify that source date is in America/Los_Angeles timezone;
2) Adjust the date to UTC before saving it into the database;
Issue fork recurring_events-3309652
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 #3
matroskeenComment #4
matroskeenComment #5
matroskeenComment #6
owenbush commentedThanks for the issue and the MR, I will try and review it as soon as possible.
Comment #9
owenbush commentedThank you for the patch, this has been merged into 2.0.x and 8.x-1.x