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

if

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