Skip to content

Object of class Carbon\Carbon could not be converted to float #1502

Open
@j3rrey

Description

@j3rrey

"laravel/framework": "5.6.*",
"tcg/voyager": "^1.1"
"jenssegers/mongodb": "^3.4",

Exception being thrown in originalIsEquivalent when comparing dates.

Object of class Carbon\Carbon could not be converted to float

here is my quickfix:

   if ($this->isDateAttribute($key)) {
            $current = $current instanceof UTCDateTime ? $this->asDateTime($current) : $current;
            $original = $original instanceof UTCDateTime ? $this->asDateTime($original) : $original;
            $original = $current instanceof Carbon && false == $original instanceof Carbon
                ? Carbon::createFromTimestamp($original)
                : $original;

            return $current == $original;
        }

Hope this helps someone <3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs investigationNeed investigation about bugs described in issuebug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions