parse_dates migration processor inconcistent timezone handling

Created on 18 September 2024, 3 months ago

Problem/Motivation

It seems like the end time and "until" times are going through some extra timezone processing that the start time does not go through.

Steps to reproduce

On a site with America/New_York site timezone, run this migration:

id: school_calendars
label: School Calendars
migration_group: calendar
migration_tags:
  - node
source:
  plugin: embedded_data
  data_rows:
    -
      title: "My Event"
      time:
        -
          value: "2024-04-12T00:00:00-04:00"
          value2: "2024-04-15T23:59:59-04:00"
  ids:
    title:
      type: string
process:
  type:
    plugin: default_value
    default_value: event
  title: title
  field_when:
    - plugin: single_value
      source: time
    - plugin: parse_dates
      entity_type: node
      bundle: event
destination:
  plugin: 'entity:node'

What I expect:
Fri, Apr 12 2024, All day
Sat, Apr 13 2024, All day
Sun, Apr 14 2024, All day
Mon, Apr 15 2024, All day

What I get:
Fri, Apr 12 2024, 12am - 7:59pm
Sat, Apr 13 2024, 12am - 7:59pm
Sun, Apr 14 2024, 12am - 7:59pm
Mon, Apr 15 2024, 12am - 7:59pm
Tue, Apr 16 2024, 12am - 7:59pm

Proposed resolution

Looks like ParseDates.php line 373 is calculating a timezone offset that is then manually applied in the next line. I am not sure what the purpose of that is, but it seems to be causing this issue.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

4.2

Component

Smart Date Recur

Created by

πŸ‡ΊπŸ‡ΈUnited States bander2

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024