function searchCity(location) {
  var requestUrl = "https://api.openweathermap.org/data/2.5/weather?q=" + location + "&appid=" + key;

  fetch(requestUrl)
    .then(function (response) {
      return response.json();
    })
    .then(function (data) {
      var todayDate = moment().format("MM/DD/YYYY");
      let currentImgEl = $(".current-img");
      currentImgEl.attr("src","https://openweathermap.org/img/wn/" + data.weather[0].icon + "@2x.png");
      currentImgEl.attr("alt", data.weather[0].description);
      $(".city-name").html(data.name + " (" + todayDate + ")");
      $(".city-name").append(currentImgEl);
      var K = data.main.temp;
      var temperatureVal = ((K-273.15)*1.8)+32;
      temperatureVal = Math.round(temperatureVal * 10) / 10;
      $(".temperature").html("Temperature: " + temperatureVal + " &#176F");
      $(".wind-speed").html("Wind Speed: " + data.wind.speed + " MPH");
      $(".humidity").html("Humidity: " + data.main.humidity + " %");
      var lat = data.coord.lat;
      var lon = data.coord.lon;
      uvIndexDetails(lat, lon);
      fiveDayForcast(location);
    });
}
//function call to get the current day weather based on the search input
function call to get the current day weather based on the search input
function call to get the current day weather based on the search input
function searchCity(location) {
  var requestUrl = "https://api.openweathermap.org/data/2.5/weather?q=" + location + "&appid=" + key;
  fetch(requestUrl)
    .then(function (response) {
      return response.json();
    })
    .then(function (data) {
      var todayDate = moment().format("MM/DD/YYYY");
      let currentImgEl = $(".current-img");
      currentImgEl.attr("src","https://openweathermap.org/img/wn/" + data.weather[0].icon + "@2x.png");
      currentImgEl.attr("alt", data.weather[0].description);
      $(".city-name").html(data.name + " (" + todayDate + ")");
      $(".city-name").append(currentImgEl);
      var K = data.main.temp;
      var temperatureVal = ((K-273.15)*1.8)+32;
      temperatureVal = Math.round(temperatureVal * 10) / 10;
      $(".temperature").html("Temperature: " + temperatureVal + " &#176F");
      $(".wind-speed").html("Wind Speed: " + data.wind.speed + " MPH");
      $(".humidity").html("Humidity: " + data.main.humidity + " %");
      var lat = data.coord.lat;
      var lon = data.coord.lon;
      uvIndexDetails(lat, lon);
      fiveDayForcast(location);
    });
}
function searchCity ( location ) { var requestUrl = "https://api.openweathermap.org/data/2.5/weather?q=" + location + "&appid=" + key ; fetch ( requestUrl ) . then ( function ( response ) { return response . json ( ) ; } ) . then ( function ( data ) { var todayDate = moment ( ) . format ( "MM/DD/YYYY" ) ; let currentImgEl = $ ( ".current-img" ) ; currentImgEl . attr ( "src" , "https://openweathermap.org/img/wn/" + data . weather [ 0 ] . icon + "@2x.png" ) ; currentImgEl . attr ( "alt" , data . weather [ 0 ] . description ) ; $ ( ".city-name" ) . html ( data . name + " (" + todayDate + ")" ) ; $ ( ".city-name" ) . append ( currentImgEl ) ; var K = data . main . temp ; var temperatureVal = ( ( K - 273.15 ) * 1.8 ) + 32 ; temperatureVal = Math . round ( temperatureVal * 10 ) / 10 ; $ ( ".temperature" ) . html ( "Temperature: " + temperatureVal + " &#176F" ) ; $ ( ".wind-speed" ) . html ( "Wind Speed: " + data . wind . speed + " MPH" ) ; $ ( ".humidity" ) . html ( "Humidity: " + data . main . humidity + " %" ) ; var lat = data . coord . lat ; var lon = data . coord . lon ; uvIndexDetails ( lat , lon ) ; fiveDayForcast ( location ) ; } ) ; }
function call to get the current day weather based on the search input
function call to get the current day weather based on the search input