Skip to content

Commit

Permalink
tweak(TB DateTime) fix constructing with Immutable
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmhh committed Aug 5, 2024
1 parent 45b3434 commit 4e2f980
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tine20/Tinebase/DateTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ public function __wakeup(): void
public function __construct($_time = "now", $_timezone = null)
{
// allow to pass instanceof DateTime
if ($_time instanceof DateTime) {
if ($_time instanceof DateTimeInterface) {
if (! $_timezone) {
$_timezone = $_time->getTimezone();
} else {
$_time = clone $_time;
$_time = DateTime::createFromInterface($_time);
$_time->setTimezone($_timezone);
}

Expand Down

0 comments on commit 4e2f980

Please sign in to comment.