src/Charcoal/Cms/Support/Helpers/DateHelper.php
private function getTimeCase()
    {
        $from = $this->from;
        $to = $this->to;

        // Single hour event
        if (!$to || $to->format('Hi') === $from->format('Hi')) {
            if ($to->format('i') == 0) {
                return 'single_round';
            }

            return 'single';
        }

        $fromTime = [
            'hour'   => $from->format('H'),
            'minute' => $from->format('i'),
        ];

        $toTime = [
            'hour'   => $to->format('H'),
            'minute' => $to->format('i'),
        ];

        $case = null;
        $case = $fromTime['hour'] !== $toTime['hour'] ? 'different_time' : $case;
        $case = $fromTime['minute'] == 0 ? 'different_time_round' : $case;
        $case = $fromTime['minute'] != $toTime['minute'] ? 'different_time' : $case;

        return $case;
    }
private function getTimeCase()
    {
        $from = $this->from;
        $to = $this->to;

        // Single hour event
        if (!$to || $to->format('Hi') === $from->format('Hi')) {
            if ($to->format('i') == 0) {
                return 'single_round';
            }

            return 'single';
        }

        $fromTime = [
            'hour'   => $from->format('H'),
            'minute' => $from->format('i'),
        ];

        $toTime = [
            'hour'   => $to->format('H'),
            'minute' => $to->format('i'),
        ];

        $case = null;
        $case = $fromTime['hour'] !== $toTime['hour'] ? 'different_time' : $case;
        $case = $fromTime['minute'] == 0 ? 'different_time_round' : $case;
        $case = $fromTime['minute'] != $toTime['minute'] ? 'different_time' : $case;

        return $case;
    }
private function getTimeCase ( ) { $ from = $ this -> from ; $ to = $ this -> to ; // Single hour event if ( ! $ to || $ to -> format ( 'Hi' ) === $ from -> format ( 'Hi' ) ) { if ( $ to -> format ( 'i' ) == 0 ) { return 'single_round' ; } return 'single' ; } $ fromTime = [ 'hour' => $ from -> format ( 'H' ) , 'minute' => $ from -> format ( 'i' ) , ] ; $ toTime = [ 'hour' => $ to -> format ( 'H' ) , 'minute' => $ to -> format ( 'i' ) , ] ; $ case = null ; $ case = $ fromTime [ 'hour' ] !== $ toTime [ 'hour' ] ? 'different_time' : $ case ; $ case = $ fromTime [ 'minute' ] == 0 ? 'different_time_round' : $ case ; $ case = $ fromTime [ 'minute' ] != $ toTime [ 'minute' ] ? 'different_time' : $ case ; return $ case ; }
Get the usage case by comparing two hours.
@return string
Get the usage case by comparing two hours .