Commit 5150990f authored by Weiser's avatar Weiser
Browse files

if

parent 16d36bc8
...@@ -241,6 +241,9 @@ const Currentdata = (props) => { ...@@ -241,6 +241,9 @@ const Currentdata = (props) => {
); );
function getData() { function getData() {
//switch
const units = document.getElementById("units").value;
const city_text = document.getElementById("city_text").value; const city_text = document.getElementById("city_text").value;
const region_text = document.getElementById("region_text").value; const region_text = document.getElementById("region_text").value;
const country_text = document.getElementById("country_text").value; const country_text = document.getElementById("country_text").value;
...@@ -328,8 +331,12 @@ const Currentdata = (props) => { ...@@ -328,8 +331,12 @@ const Currentdata = (props) => {
filterArray.push("last_updated"); filterArray.push("last_updated");
} }
if (temp) { if (temp) {
filterArray.push("temp"); if(units == world){
filterArray.push("temp_f");
}
filterArray.push("temp_f");
} }
if (id_day) { if (id_day) {
filterArray.push("id_day"); filterArray.push("id_day");
} }
...@@ -343,7 +350,10 @@ const Currentdata = (props) => { ...@@ -343,7 +350,10 @@ const Currentdata = (props) => {
filterArray.push("condition_code"); filterArray.push("condition_code");
} }
if (wind) { if (wind) {
filterArray.push("wind"); if(units == world){
filterArray.push("wind_mph");
}
filterArray.push("wind_kph");
} }
if (wind_degree) { if (wind_degree) {
filterArray.push("wind_degree"); filterArray.push("wind_degree");
...@@ -352,10 +362,15 @@ const Currentdata = (props) => { ...@@ -352,10 +362,15 @@ const Currentdata = (props) => {
filterArray.push("wind_dir"); filterArray.push("wind_dir");
} }
if (pressure) { if (pressure) {
filterArray.push("pressure"); if(units == world){
filterArray.push("temp_mb");
}
filterArray.push("pressure_in");
}
if (precip) {if(units == world){
filterArray.push("temp_mm");
} }
if (precip) { filterArray.push("precip_in");
filterArray.push("precip");
} }
if (humidity) { if (humidity) {
filterArray.push("humidity"); filterArray.push("humidity");
...@@ -364,25 +379,43 @@ const Currentdata = (props) => { ...@@ -364,25 +379,43 @@ const Currentdata = (props) => {
filterArray.push("cloud"); filterArray.push("cloud");
} }
if (feelslike) { if (feelslike) {
filterArray.push("feelslike"); if(units == world){
filterArray.push("feelslike_c");
}
filterArray.push("feelslike_f");
} }
if (windchill) { if (windchill) {
filterArray.push("windchill"); if(units == world){
filterArray.push("windchill_c");
}
filterArray.push("windchill_f");
} }
if (heatindex) { if (heatindex) {
filterArray.push("heatindex"); if(units == world){
filterArray.push("heatindex_c");
}
filterArray.push("heatindex_f");
} }
if (dewpoint) { if (dewpoint) {
filterArray.push("dewpoint"); if(units == world){
filterArray.push("dewpoint_c");
}
filterArray.push("dewpoint_f");
} }
if (vis) { if (vis) {
filterArray.push("vis"); if(units == world){
filterArray.push("vis_miles");
}
filterArray.push("vis_miles");
} }
if (uv) { if (uv) {
filterArray.push("uv"); filterArray.push("uv");
} }
if (gust) { if (gust) {
filterArray.push("gust"); if(units == world){
filterArray.push("gust_kph");
}
filterArray.push("gust_mph");
} }
if (air_quality_co) { if (air_quality_co) {
filterArray.push("air_quality_co"); filterArray.push("air_quality_co");
......
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