public function getJsonValue()
    {
        $dts = $this->getDateTimes();
        $hasTime = $this->hasTime();
        $isFloating = $this->isFloating();

        $tz = $dts[0]->getTimeZone();
        $isUtc = $isFloating ? false : in_array($tz->getName(), ['UTC', 'GMT', 'Z']);

        return array_map(
            function (DateTimeInterface $dt) use ($hasTime, $isUtc) {
                if ($hasTime) {
                    return $dt->format('Y-m-d\\TH:i:s').($isUtc ? 'Z' : '');
                } else {
                    return $dt->format('Y-m-d');
                }
            },
            $dts
        );
    }
public function getJsonValue()
    {
        $dts = $this->getDateTimes();
        $hasTime = $this->hasTime();
        $isFloating = $this->isFloating();

        $tz = $dts[0]->getTimeZone();
        $isUtc = $isFloating ? false : in_array($tz->getName(), ['UTC', 'GMT', 'Z']);

        return array_map(
            function (DateTimeInterface $dt) use ($hasTime, $isUtc) {
                if ($hasTime) {
                    return $dt->format('Y-m-d\\TH:i:s').($isUtc ? 'Z' : '');
                } else {
                    return $dt->format('Y-m-d');
                }
            },
            $dts
        );
    }
public function getJsonValue ( ) { $ dts = $ this -> getDateTimes ( ) ; $ hasTime = $ this -> hasTime ( ) ; $ isFloating = $ this -> isFloating ( ) ; $ tz = $ dts [ 0 ] -> getTimeZone ( ) ; $ isUtc = $ isFloating ? false : in_array ( $ tz -> getName ( ) , [ 'UTC' , 'GMT' , 'Z' ] ) ; return array_map ( function ( DateTimeInterface $ dt ) use ( $ hasTime , $ isUtc ) { if ( $ hasTime ) { return $ dt -> format ( 'Y-m-d\\TH:i:s' ) . ( $ isUtc ? 'Z' : '' ) ; } else { return $ dt -> format ( 'Y-m-d' ) ; } } , $ dts ) ; }
Returns the value, in the format it should be encoded for JSON.

This method must always return an array.

@return array
Returns the value in the format it should be encoded for JSON .