Commit a50ceffe authored by EnesKarakas's avatar EnesKarakas
Browse files

dwa

parent 82d812a0
......@@ -278,16 +278,32 @@ const WeatherForecastData = (props) => {
/>
<label for="hour_dewpoint">Hour Dew Point</label>
<br />
<input type="checkbox" id="hourly_will_it_rain" class="checkBoxFilter" />
<input
type="checkbox"
id="hourly_will_it_rain"
class="checkBoxFilter"
/>
<label for="hourly_will_it_rain">Will it Rain</label>
<br />
<input type="checkbox" id="hourly_chance_of_rain" class="checkBoxFilter" />
<input
type="checkbox"
id="hourly_chance_of_rain"
class="checkBoxFilter"
/>
<label for="hourly_chance_of_rain">Chance of Rain</label>
<br />
<input type="checkbox" id="hourly_will_it_snow" class="checkBoxFilter" />
<input
type="checkbox"
id="hourly_will_it_snow"
class="checkBoxFilter"
/>
<label for="hourly_will_it_snow">Will it Snow</label>
<br />
<input type="checkbox" id="hourly_chance_of_snow" class="checkBoxFilter" />
<input
type="checkbox"
id="hourly_chance_of_snow"
class="checkBoxFilter"
/>
<label for="hourly_chance_of_snow">Chance of Snow</label>
<br />
<input type="checkbox" id="hour_vis" class="checkBoxFilter" />
......@@ -340,14 +356,13 @@ const WeatherForecastData = (props) => {
);
function getData() {
const units = document.getElementById("units").value;
const city = document.getElementById("city_text").value;
const region = document.getElementById("region_text").value;
const country = document.getElementById("country_text").value;
const latitude = document.getElementById("latitude_text").value;
const longitude = document.getElementById("longitude_text").value;
const city_text = document.getElementById("city_text").value;
const region_text = document.getElementById("region_text").value;
const country_text = document.getElementById("country_text").value;
const latitude_text = document.getElementById("latitude_text").value;
const longitude_text = document.getElementById("longitude_text").value;
const name = document.getElementById("name").checked;
const regionCheckbox = document.getElementById("region").checked;
......@@ -379,9 +394,6 @@ const WeatherForecastData = (props) => {
const daily_chance_of_snow = document.getElementById(
"daily_chance_of_snow"
).checked;
const condition_text = document.getElementById("condition_text").checked;
const condition_icon = document.getElementById("condition_icon").checked;
const condition_code = document.getElementById("condition_code").checked;
const uv = document.getElementById("uv").checked;
const sunrise = document.getElementById("sunrise").checked;
const sunset = document.getElementById("sunset").checked;
......@@ -394,15 +406,6 @@ const WeatherForecastData = (props) => {
const hour_time = document.getElementById("hour_time").checked;
const hour_temp = document.getElementById("hour_temp").checked;
const hour_is_day = document.getElementById("hour_is_day").checked;
const hour_condition_text = document.getElementById(
"hour_condition_text"
).checked;
const hour_condition_icon = document.getElementById(
"hour_condition_icon"
).checked;
const hour_condition_code = document.getElementById(
"hour_condition_code"
).checked;
const hour_wind = document.getElementById("hour_wind").checked;
const hour_wind_degree =
document.getElementById("hour_wind_degree").checked;
......@@ -415,10 +418,18 @@ const WeatherForecastData = (props) => {
const hour_windchill = document.getElementById("hour_windchill").checked;
const hour_heatindex = document.getElementById("hour_heatindex").checked;
const hour_dewpoint = document.getElementById("hour_dewpoint").checked;
const hourly_will_it_rain = document.getElementById("hourly_will_it_rain").checked;
const hourly_chance_of_rain = document.getElementById("hourly_chance_of_rain").checked;
const hourly_will_it_snow = document.getElementById("hourly_will_it_snow").checked;
const hourly_chance_of_snow = document.getElementById("hourly_chance_of_snow").checked;
const hourly_will_it_rain = document.getElementById(
"hourly_will_it_rain"
).checked;
const hourly_chance_of_rain = document.getElementById(
"hourly_chance_of_rain"
).checked;
const hourly_will_it_snow = document.getElementById(
"hourly_will_it_snow"
).checked;
const hourly_chance_of_snow = document.getElementById(
"hourly_chance_of_snow"
).checked;
const hour_vis = document.getElementById("hour_vis").checked;
const hour_gust = document.getElementById("hour_gust").checked;
const hour_uv = document.getElementById("hour_uv").checked;
......@@ -437,27 +448,42 @@ const WeatherForecastData = (props) => {
if (last_updated) filterArray.push("last_updated");
if (date) filterArray.push("date");
if (date_epoch) filterArray.push("date_epoch");
if (maxtemp) if(units=="world"){
if (maxtemp)
if (units == "world") {
filterArray.push("maxtemp_c");
}else{
filterArray.push("maxtemp_f");}
if (mintemp) if(units=="world"){
} else {
filterArray.push("maxtemp_f");
}
if (mintemp)
if (units == "world") {
filterArray.push("mintemp_c");
}else{filterArray.push("mintemp");}
if (avgtemp) if(units=="world"){
} else {
filterArray.push("mintemp");
}
if (avgtemp)
if (units == "world") {
filterArray.push("avgtemp_c");
}else{filterArray.push("avgtemp_f");
} else {
filterArray.push("avgtemp_f");
}
if (maxwind) if(units=="world"){
if (maxwind)
if (units == "world") {
filterArray.push("maxwind_kph");
}else{filterArray.push("maxwind_mph");}
if (totalprecip)if(units=="world"){
} else {
filterArray.push("maxwind_mph");
}
if (totalprecip)
if (units == "world") {
filterArray.push("totalprecip_mm");
}else{ filterArray.push("totalprecip_in");}
if (avgvis) if(units=="world"){
} else {
filterArray.push("totalprecip_in");
}
if (avgvis)
if (units == "world") {
filterArray.push("avgis_km");
}else{
filterArray.push("avgvis_miles");}
} else {
filterArray.push("avgvis_miles");
}
if (avghumidity) filterArray.push("avghumidity");
if (daily_will_it_rain) filterArray.push("daily_will_it_rain");
if (daily_chance_of_rain) filterArray.push("daily_chance_of_rain");
......@@ -475,51 +501,75 @@ const WeatherForecastData = (props) => {
if (moon_illumination) filterArray.push("moon_illumination");
if (hour_time_epoch) filterArray.push("hourly_time_epoch");
if (hour_time) filterArray.push("hourly_time");
if (hour_temp) if(units=="world"){
if (hour_temp)
if (units == "world") {
filterArray.push("hourly_temp_c");
}else{
filterArray.push("hourly_temp_f");}
} else {
filterArray.push("hourly_temp_f");
}
if (hour_is_day) filterArray.push("hourly_is_day");
if (hour_wind)if(units=="world"){
if (hour_wind)
if (units == "world") {
filterArray.push("hourly_wind_kph");
}else{
filterArray.push("hourly_wind_mph");}
} else {
filterArray.push("hourly_wind_mph");
}
if (hour_wind_degree) filterArray.push("hourly_wind_degree");
if (hour_wind_dir) filterArray.push("hourly_wind_dir");
if (hour_pressure) if(units=="world"){
if (hour_pressure)
if (units == "world") {
filterArray.push("hourly_pressure_mb");
}else{filterArray.push("hourly_pressure_in");}
if (hour_precip) if(units=="world"){
} else {
filterArray.push("hourly_pressure_in");
}
if (hour_precip)
if (units == "world") {
filterArray.push("hourly_precip_mm");
}else{
filterArray.push("hourly_precip_in");}
} else {
filterArray.push("hourly_precip_in");
}
if (hour_humidity) filterArray.push("hourly_humidity");
if (hour_cloud) filterArray.push("hourly_cloud");
if (hour_feelslike) if(units=="world"){
if (hour_feelslike)
if (units == "world") {
filterArray.push("hourly_feelslike_c");
}else{filterArray.push("hourly_feelslike_f");}
if (hour_windchill) if(units=="world"){
} else {
filterArray.push("hourly_feelslike_f");
}
if (hour_windchill)
if (units == "world") {
filterArray.push("hourly_windchill_c");
}else{filterArray.push("hourly_windchill_f");}
if (hour_heatindex)if(units=="world"){
} else {
filterArray.push("hourly_windchill_f");
}
if (hour_heatindex)
if (units == "world") {
filterArray.push("hourly_heatindex_c");
}else{ filterArray.push("hourly_heatindex_f");}
if (hour_dewpoint) if(units=="world"){
} else {
filterArray.push("hourly_heatindex_f");
}
if (hour_dewpoint)
if (units == "world") {
filterArray.push("hourly_dewpoint_c");
}else{
filterArray.push("hourly_dewpoint_f");}
} else {
filterArray.push("hourly_dewpoint_f");
}
if (hourly_will_it_rain) filterArray.push("hourly_will_it_rain");
if (hourly_chance_of_rain) filterArray.push("hourly_chance_of_rain");
if (hourly_will_it_snow) filterArray.push("hourly_will_it_snow");
if (hourly_chance_of_snow) filterArray.push("hourly_chance_of_snow");
if (hour_vis) if(units=="world"){
if (hour_vis)
if (units == "world") {
filterArray.push("hourly_vis_km");
}else{
filterArray.push("hourly_vis_miles");}
if (hour_gust) if(units=="world"){
} else {
filterArray.push("hourly_vis_miles");
}
if (hour_gust)
if (units == "world") {
filterArray.push("hourly_gust_kph");
}else{
filterArray.push("hourly_gust_mph");}
} else {
filterArray.push("hourly_gust_mph");
}
if (hour_uv) filterArray.push("hourly_uv");
let filterString = filterArray.join(",");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment