original_string: protected function getDateParameterInTimezone($date, $timezone)
      {
          $timezoneToUse = null;
          // if the requested date is not YYYY-MM-DD, we need to ensure
          //  it is relative to the website's timezone
          if (in_array($date, array('today', 'yesterday'))) {
              // today is at midnight; we really want to get the time now, so that
              // * if the website is UTC+12 and it is 5PM now in UTC, the calendar will allow to select the UTC "tomorrow"
              // * if the website is UTC-12 and it is 5AM now in UTC, the calendar will allow to select the UTC "yesterday"
              if ($date == 'today') {
                  $date = 'now';
              } elseif ($date == 'yesterday') {
                  $date = 'yesterdaySameTime';
              }
              $timezoneToUse = $timezone;
          }
          return Date::factory($date, $timezoneToUse);
      }
code: protected function getDateParameterInTimezone($date, $timezone)
      {
          $timezoneToUse = null;
          // if the requested date is not YYYY-MM-DD, we need to ensure
          //  it is relative to the website's timezone
          if (in_array($date, array('today', 'yesterday'))) {
              // today is at midnight; we really want to get the time now, so that
              // * if the website is UTC+12 and it is 5PM now in UTC, the calendar will allow to select the UTC "tomorrow"
              // * if the website is UTC-12 and it is 5AM now in UTC, the calendar will allow to select the UTC "yesterday"
              if ($date == 'today') {
                  $date = 'now';
              } elseif ($date == 'yesterday') {
                  $date = 'yesterdaySameTime';
              }
              $timezoneToUse = $timezone;
          }
          return Date::factory($date, $timezoneToUse);
      }
code_tokens: protected function getDateParameterInTimezone ( $ date , $ timezone ) { $ timezoneToUse = null ; // if the requested date is not YYYY-MM-DD, we need to ensure //  it is relative to the website's timezone if ( in_array ( $ date , array ( 'today' , 'yesterday' ) ) ) { // today is at midnight; we really want to get the time now, so that // * if the website is UTC+12 and it is 5PM now in UTC, the calendar will allow to select the UTC "tomorrow" // * if the website is UTC-12 and it is 5AM now in UTC, the calendar will allow to select the UTC "yesterday" if ( $ date == 'today' ) { $ date = 'now' ; } elseif ( $ date == 'yesterday' ) { $ date = 'yesterdaySameTime' ; } $ timezoneToUse = $ timezone ; } return Date :: factory ( $ date , $ timezoneToUse ) ; }
docstring: Helper method that converts `"today"` or `"yesterday"` to the specified timezone.
  If the date is absolute, ie. YYYY-MM-DD, it will not be converted to the timezone.
  
  @param string $date `'today'`, `'yesterday'`, `'YYYY-MM-DD'`
  @param string $timezone The timezone to use.
  @return Date
  @api
docstring_tokens: Helper method that converts today or yesterday to the specified timezone . If the date is absolute ie . YYYY - MM - DD it will not be converted to the timezone .