There is no clean way to initialise the \Drupal\time_field\Time object straight from a \DateTime object. From a DX perspective it would be nice to introduce a new constructor createFromDateTime to initialise the time object from a date time.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Erik Frèrejean created an issue. See original summary.

Erik Frèrejean’s picture

Assigned: Erik Frèrejean » Unassigned
Status: Active » Needs review
FileSize
1.6 KB
liesm’s picture

Status: Needs review » Reviewed & tested by the community

Seems like an usable change.

  • Erik Frèrejean authored cab40e3 on 2.x
    Issue #3169679 by Erik Frèrejean, liesm: Create time from date time
    
BramDriesen’s picture

Status: Reviewed & tested by the community » Fixed

Thank you all!

BramDriesen’s picture

BramDriesen’s picture

Version: 8.x-1.x-dev » 2.x-dev

Status: Fixed » Closed (fixed)

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