public static function formatted_timeframe($startStr, $endStr)
    {
        $str = null;

        if ($startStr == $endStr) {
            return null;
        }

        $startTime = strtotime($startStr->value);
        $endTime = strtotime($endStr->value);

        if ($startTime == $endTime) {
            return null;
        }

        if ($endStr) {
            //time frame is only applicable if both start and end time is on the same day
            if (date('Y-m-d', $startTime) == date('Y-m-d', $endTime)) {
                $str = date('g:ia', $startTime) . ' - ' . date('g:ia', $endTime);
            }
        } else {
            $str = date('g:ia', $startTime);
        }

        return $str;
    }