original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Formatted time frame
  Returns either a string or null
  Time frame is only applicable if both start and end time is on the same day
  @param string $startStr
  @param string $endStr
  @return string|null
docstring_tokens: Formatted time frame Returns either a string or null Time frame is only applicable if both start and end time is on the same day