-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
15 lines (15 loc) · 17.6 KB
/
Copy pathtest.js
File metadata and controls
15 lines (15 loc) · 17.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
var weather = {
"cod": "200", "message": 0, "cnt": 40, "list":
[{ "dt": 1604750400, "main": { "temp": 301.59, "feels_like": 298.76, "temp_min": 301.59, "temp_max": 302.05, "pressure": 1016, "sea_level": 1016, "grnd_level": 989, "humidity": 21, "temp_kf": -0.46 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01d" }], "clouds": { "all": 0 }, "wind": { "speed": 2.16, "deg": 328 }, "visibility": 10000, "pop": 0, "sys": { "pod": "d" }, "dt_txt": "2020-11-07 12:00:00" }, { "dt": 1604761200, "main": { "temp": 299.97, "feels_like": 297.43, "temp_min": 299.64, "temp_max": 299.97, "pressure": 1017, "sea_level": 1017, "grnd_level": 992, "humidity": 19, "temp_kf": 0.33 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01n" }], "clouds": { "all": 0 }, "wind": { "speed": 1.06, "deg": 321 }, "visibility": 10000, "pop": 0, "sys": { "pod": "n" }, "dt_txt": "2020-11-07 15:00:00" }, { "dt": 1604772000, "main": { "temp": 298.12, "feels_like": 295.04, "temp_min": 297.91, "temp_max": 298.12, "pressure": 1016, "sea_level": 1016, "grnd_level": 991, "humidity": 17, "temp_kf": 0.21 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01n" }], "clouds": { "all": 0 }, "wind": { "speed": 1.21, "deg": 297 }, "visibility": 10000, "pop": 0, "sys": { "pod": "n" }, "dt_txt": "2020-11-07 18:00:00" }, { "dt": 1604782800, "main": { "temp": 295.9, "feels_like": 293.23, "temp_min": 295.86, "temp_max": 295.9, "pressure": 1016, "sea_level": 1016, "grnd_level": 991, "humidity": 20, "temp_kf": 0.04 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01n" }], "clouds": { "all": 0 }, "wind": { "speed": 0.7, "deg": 294 }, "visibility": 10000, "pop": 0, "sys": { "pod": "n" }, "dt_txt": "2020-11-07 21:00:00" }, { "dt": 1604793600, "main": { "temp": 294.93, "feels_like": 292.04, "temp_min": 294.93, "temp_max": 294.93, "pressure": 1016, "sea_level": 1016, "grnd_level": 991, "humidity": 21, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01n" }], "clouds": { "all": 0 }, "wind": { "speed": 0.99, "deg": 291 }, "visibility": 10000, "pop": 0, "sys": { "pod": "n" }, "dt_txt": "2020-11-08 00:00:00" }, { "dt": 1604804400, "main": { "temp": 295.94, "feels_like": 292.9, "temp_min": 295.94, "temp_max": 295.94, "pressure": 1019, "sea_level": 1019, "grnd_level": 993, "humidity": 20, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01d" }], "clouds": { "all": 0 }, "wind": { "speed": 1.23, "deg": 0 }, "visibility": 10000, "pop": 0, "sys": { "pod": "d" }, "dt_txt": "2020-11-08 03:00:00" }, { "dt": 1604815200, "main": { "temp": 301.59, "feels_like": 299.3, "temp_min": 301.59, "temp_max": 301.59, "pressure": 1018, "sea_level": 1018, "grnd_level": 993, "humidity": 14, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01d" }], "clouds": { "all": 0 }, "wind": { "speed": 0.11, "deg": 275 }, "visibility": 10000, "pop": 0, "sys": { "pod": "d" }, "dt_txt": "2020-11-08 06:00:00" }, { "dt": 1604826000, "main": { "temp": 303.8, "feels_like": 300.43, "temp_min": 303.8, "temp_max": 303.8, "pressure": 1015, "sea_level": 1015, "grnd_level": 991, "humidity": 12, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01d" }], "clouds": { "all": 0 }, "wind": { "speed": 1.58, "deg": 316 }, "visibility": 10000, "pop": 0, "sys": { "pod": "d" }, "dt_txt": "2020-11-08 09:00:00" }, { "dt": 1604836800, "main": { "temp": 301.72, "feels_like": 298.9, "temp_min": 301.72, "temp_max": 301.72, "pressure": 1015, "sea_level": 1015, "grnd_level": 990, "humidity": 14, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01d" }], "clouds": { "all": 0 }, "wind": { "speed": 0.89, "deg": 11 }, "visibility": 10000, "pop": 0, "sys": { "pod": "d" }, "dt_txt": "2020-11-08 12:00:00" }, { "dt": 1604847600, "main": { "temp": 299.18, "feels_like": 296.06, "temp_min": 299.18, "temp_max": 299.18, "pressure": 1017, "sea_level": 1017, "grnd_level": 992, "humidity": 16, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01n" }], "clouds": { "all": 0 }, "wind": { "speed": 1.28, "deg": 38 }, "visibility": 10000, "pop": 0, "sys": { "pod": "n" }, "dt_txt": "2020-11-08 15:00:00" }, { "dt": 1604858400, "main": { "temp": 297.58, "feels_like": 294.85, "temp_min": 297.58, "temp_max": 297.58, "pressure": 1016, "sea_level": 1016, "grnd_level": 991, "humidity": 18, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01n" }], "clouds": { "all": 0 }, "wind": { "speed": 0.78, "deg": 98 }, "visibility": 10000, "pop": 0, "sys": { "pod": "n" }, "dt_txt": "2020-11-08 18:00:00" }, { "dt": 1604869200, "main": { "temp": 295.63, "feels_like": 293.17, "temp_min": 295.63, "temp_max": 295.63, "pressure": 1015, "sea_level": 1015, "grnd_level": 990, "humidity": 20, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01n" }], "clouds": { "all": 0 }, "wind": { "speed": 0.36, "deg": 88 }, "visibility": 10000, "pop": 0, "sys": { "pod": "n" }, "dt_txt": "2020-11-08 21:00:00" }, { "dt": 1604880000, "main": { "temp": 294.68, "feels_like": 292.31, "temp_min": 294.68, "temp_max": 294.68, "pressure": 1015, "sea_level": 1015, "grnd_level": 989, "humidity": 21, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01n" }], "clouds": { "all": 0 }, "wind": { "speed": 0.21, "deg": 335 }, "visibility": 10000, "pop": 0, "sys": { "pod": "n" }, "dt_txt": "2020-11-09 00:00:00" }, { "dt": 1604890800, "main": { "temp": 296.31, "feels_like": 293.96, "temp_min": 296.31, "temp_max": 296.31, "pressure": 1017, "sea_level": 1017, "grnd_level": 991, "humidity": 19, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01d" }], "clouds": { "all": 0 }, "wind": { "speed": 0.17, "deg": 68 }, "visibility": 10000, "pop": 0, "sys": { "pod": "d" }, "dt_txt": "2020-11-09 03:00:00" }, { "dt": 1604901600, "main": { "temp": 301.79, "feels_like": 299.4, "temp_min": 301.79, "temp_max": 301.79, "pressure": 1016, "sea_level": 1016, "grnd_level": 991, "humidity": 14, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01d" }], "clouds": { "all": 0 }, "wind": { "speed": 0.28, "deg": 285 }, "visibility": 10000, "pop": 0, "sys": { "pod": "d" }, "dt_txt": "2020-11-09 06:00:00" }, { "dt": 1604912400, "main": { "temp": 303.89, "feels_like": 300.63, "temp_min": 303.89, "temp_max": 303.89, "pressure": 1013, "sea_level": 1013, "grnd_level": 988, "humidity": 12, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01d" }], "clouds": { "all": 0 }, "wind": { "speed": 1.44, "deg": 315 }, "visibility": 10000, "pop": 0, "sys": { "pod": "d" }, "dt_txt": "2020-11-09 09:00:00" }, { "dt": 1604923200, "main": { "temp": 301.9, "feels_like": 298.7, "temp_min": 301.9, "temp_max": 301.9, "pressure": 1012, "sea_level": 1012, "grnd_level": 987, "humidity": 14, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01d" }], "clouds": { "all": 0 }, "wind": { "speed": 1.45, "deg": 24 }, "visibility": 10000, "pop": 0, "sys": { "pod": "d" }, "dt_txt": "2020-11-09 12:00:00" }, { "dt": 1604934000, "main": { "temp": 299.21, "feels_like": 295.77, "temp_min": 299.21, "temp_max": 299.21, "pressure": 1014, "sea_level": 1014, "grnd_level": 989, "humidity": 16, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01n" }], "clouds": { "all": 0 }, "wind": { "speed": 1.74, "deg": 47 }, "visibility": 10000, "pop": 0, "sys": { "pod": "n" }, "dt_txt": "2020-11-09 15:00:00" }, { "dt": 1604944800, "main": { "temp": 297.33, "feels_like": 294.37, "temp_min": 297.33, "temp_max": 297.33, "pressure": 1014, "sea_level": 1014, "grnd_level": 989, "humidity": 19, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01n" }], "clouds": { "all": 0 }, "wind": { "speed": 1.21, "deg": 92 }, "visibility": 10000, "pop": 0, "sys": { "pod": "n" }, "dt_txt": "2020-11-09 18:00:00" }, { "dt": 1604955600, "main": { "temp": 295.9, "feels_like": 293.2, "temp_min": 295.9, "temp_max": 295.9, "pressure": 1013, "sea_level": 1013, "grnd_level": 988, "humidity": 20, "temp_kf": 0 }, "weather": [{ "id": 802, "main": "Clouds", "description": "scattered clouds", "icon": "03n" }], "clouds": { "all": 25 }, "wind": { "speed": 0.75, "deg": 111 }, "visibility": 10000, "pop": 0, "sys": { "pod": "n" }, "dt_txt": "2020-11-09 21:00:00" }, { "dt": 1604966400, "main": { "temp": 295.02, "feels_like": 292.31, "temp_min": 295.02, "temp_max": 295.02, "pressure": 1013, "sea_level": 1013, "grnd_level": 988, "humidity": 22, "temp_kf": 0 }, "weather": [{ "id": 803, "main": "Clouds", "description": "broken clouds", "icon": "04n" }], "clouds": { "all": 62 }, "wind": { "speed": 0.87, "deg": 115 }, "visibility": 10000, "pop": 0, "sys": { "pod": "n" }, "dt_txt": "2020-11-10 00:00:00" }, { "dt": 1604977200, "main": { "temp": 296.09, "feels_like": 292.97, "temp_min": 296.09, "temp_max": 296.09, "pressure": 1015, "sea_level": 1015, "grnd_level": 990, "humidity": 20, "temp_kf": 0 }, "weather": [{ "id": 803, "main": "Clouds", "description": "broken clouds", "icon": "04d" }], "clouds": { "all": 75 }, "wind": { "speed": 1.38, "deg": 114 }, "visibility": 10000, "pop": 0, "sys": { "pod": "d" }, "dt_txt": "2020-11-10 03:00:00" }, { "dt": 1604988000, "main": { "temp": 301.36, "feels_like": 298.4, "temp_min": 301.36, "temp_max": 301.36, "pressure": 1015, "sea_level": 1015, "grnd_level": 990, "humidity": 15, "temp_kf": 0 }, "weather": [{ "id": 803, "main": "Clouds", "description": "broken clouds", "icon": "04d" }], "clouds": { "all": 65 }, "wind": { "speed": 1.21, "deg": 129 }, "visibility": 10000, "pop": 0, "sys": { "pod": "d" }, "dt_txt": "2020-11-10 06:00:00" }, { "dt": 1604998800, "main": { "temp": 303.54, "feels_like": 301.16, "temp_min": 303.54, "temp_max": 303.54, "pressure": 1012, "sea_level": 1012, "grnd_level": 988, "humidity": 13, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01d" }], "clouds": { "all": 9 }, "wind": { "speed": 0.34, "deg": 59 }, "visibility": 10000, "pop": 0, "sys": { "pod": "d" }, "dt_txt": "2020-11-10 09:00:00" }, { "dt": 1605009600, "main": { "temp": 301.37, "feels_like": 298.78, "temp_min": 301.37, "temp_max": 301.37, "pressure": 1012, "sea_level": 1012, "grnd_level": 987, "humidity": 15, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01d" }], "clouds": { "all": 6 }, "wind": { "speed": 0.68, "deg": 49 }, "visibility": 10000, "pop": 0, "sys": { "pod": "d" }, "dt_txt": "2020-11-10 12:00:00" }, { "dt": 1605020400, "main": { "temp": 299.07, "feels_like": 295.84, "temp_min": 299.07, "temp_max": 299.07, "pressure": 1014, "sea_level": 1014, "grnd_level": 989, "humidity": 17, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01n" }], "clouds": { "all": 0 }, "wind": { "speed": 1.57, "deg": 66 }, "visibility": 10000, "pop": 0, "sys": { "pod": "n" }, "dt_txt": "2020-11-10 15:00:00" }, { "dt": 1605031200, "main": { "temp": 297.14, "feels_like": 293.84, "temp_min": 297.14, "temp_max": 297.14, "pressure": 1015, "sea_level": 1015, "grnd_level": 989, "humidity": 20, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01n" }], "clouds": { "all": 0 }, "wind": { "speed": 1.81, "deg": 89 }, "visibility": 10000, "pop": 0, "sys": { "pod": "n" }, "dt_txt": "2020-11-10 18:00:00" }, { "dt": 1605042000, "main": { "temp": 295.31, "feels_like": 292.28, "temp_min": 295.31, "temp_max": 295.31, "pressure": 1015, "sea_level": 1015, "grnd_level": 989, "humidity": 22, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01n" }], "clouds": { "all": 0 }, "wind": { "speed": 1.37, "deg": 99 }, "visibility": 10000, "pop": 0, "sys": { "pod": "n" }, "dt_txt": "2020-11-10 21:00:00" }, { "dt": 1605052800, "main": { "temp": 294.5, "feels_like": 291.63, "temp_min": 294.5, "temp_max": 294.5, "pressure": 1015, "sea_level": 1015, "grnd_level": 990, "humidity": 24, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01n" }], "clouds": { "all": 0 }, "wind": { "speed": 1.25, "deg": 111 }, "visibility": 10000, "pop": 0, "sys": { "pod": "n" }, "dt_txt": "2020-11-11 00:00:00" }, { "dt": 1605063600, "main": { "temp": 295.63, "feels_like": 292.38, "temp_min": 295.63, "temp_max": 295.63, "pressure": 1017, "sea_level": 1017, "grnd_level": 992, "humidity": 23, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01d" }], "clouds": { "all": 0 }, "wind": { "speed": 1.87, "deg": 110 }, "visibility": 10000, "pop": 0, "sys": { "pod": "d" }, "dt_txt": "2020-11-11 03:00:00" }, { "dt": 1605074400, "main": { "temp": 300.77, "feels_like": 297.68, "temp_min": 300.77, "temp_max": 300.77, "pressure": 1017, "sea_level": 1017, "grnd_level": 992, "humidity": 18, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01d" }], "clouds": { "all": 0 }, "wind": { "speed": 1.83, "deg": 124 }, "visibility": 10000, "pop": 0, "sys": { "pod": "d" }, "dt_txt": "2020-11-11 06:00:00" }, { "dt": 1605085200, "main": { "temp": 302.73, "feels_like": 299.7, "temp_min": 302.73, "temp_max": 302.73, "pressure": 1014, "sea_level": 1014, "grnd_level": 989, "humidity": 15, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01d" }], "clouds": { "all": 0 }, "wind": { "speed": 1.53, "deg": 111 }, "visibility": 10000, "pop": 0, "sys": { "pod": "d" }, "dt_txt": "2020-11-11 09:00:00" }, { "dt": 1605096000, "main": { "temp": 300.94, "feels_like": 298.71, "temp_min": 300.94, "temp_max": 300.94, "pressure": 1014, "sea_level": 1014, "grnd_level": 989, "humidity": 18, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01n" }], "clouds": { "all": 0 }, "wind": { "speed": 0.63, "deg": 81 }, "visibility": 10000, "pop": 0, "sys": { "pod": "n" }, "dt_txt": "2020-11-11 12:00:00" }, { "dt": 1605106800, "main": { "temp": 298.46, "feels_like": 295.61, "temp_min": 298.46, "temp_max": 298.46, "pressure": 1016, "sea_level": 1016, "grnd_level": 991, "humidity": 23, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01n" }], "clouds": { "all": 0 }, "wind": { "speed": 1.85, "deg": 65 }, "visibility": 10000, "pop": 0, "sys": { "pod": "n" }, "dt_txt": "2020-11-11 15:00:00" }, { "dt": 1605117600, "main": { "temp": 297.22, "feels_like": 294.93, "temp_min": 297.22, "temp_max": 297.22, "pressure": 1017, "sea_level": 1017, "grnd_level": 992, "humidity": 26, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01n" }], "clouds": { "all": 0 }, "wind": { "speed": 1.22, "deg": 84 }, "visibility": 10000, "pop": 0, "sys": { "pod": "n" }, "dt_txt": "2020-11-11 18:00:00" }, { "dt": 1605128400, "main": { "temp": 295.95, "feels_like": 293.81, "temp_min": 295.95, "temp_max": 295.95, "pressure": 1017, "sea_level": 1017, "grnd_level": 992, "humidity": 28, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01n" }], "clouds": { "all": 0 }, "wind": { "speed": 0.99, "deg": 114 }, "visibility": 10000, "pop": 0, "sys": { "pod": "n" }, "dt_txt": "2020-11-11 21:00:00" }, { "dt": 1605139200, "main": { "temp": 295.19, "feels_like": 293.16, "temp_min": 295.19, "temp_max": 295.19, "pressure": 1017, "sea_level": 1017, "grnd_level": 992, "humidity": 30, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01n" }], "clouds": { "all": 0 }, "wind": { "speed": 0.93, "deg": 93 }, "visibility": 10000, "pop": 0, "sys": { "pod": "n" }, "dt_txt": "2020-11-12 00:00:00" }, { "dt": 1605150000, "main": { "temp": 295.83, "feels_like": 293.64, "temp_min": 295.83, "temp_max": 295.83, "pressure": 1019, "sea_level": 1019, "grnd_level": 994, "humidity": 29, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01d" }], "clouds": { "all": 0 }, "wind": { "speed": 1.17, "deg": 68 }, "visibility": 10000, "pop": 0, "sys": { "pod": "d" }, "dt_txt": "2020-11-12 03:00:00" }, { "dt": 1605160800, "main": { "temp": 301.03, "feels_like": 299.4, "temp_min": 301.03, "temp_max": 301.03, "pressure": 1019, "sea_level": 1019, "grnd_level": 994, "humidity": 22, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01d" }], "clouds": { "all": 0 }, "wind": { "speed": 0.49, "deg": 108 }, "visibility": 10000, "pop": 0, "sys": { "pod": "d" }, "dt_txt": "2020-11-12 06:00:00" }, { "dt": 1605171600, "main": { "temp": 303.04, "feels_like": 300.71, "temp_min": 303.04, "temp_max": 303.04, "pressure": 1016, "sea_level": 1016, "grnd_level": 991, "humidity": 17, "temp_kf": 0 }, "weather": [{ "id": 800, "main": "Clear", "description": "clear sky", "icon": "01d" }], "clouds": { "all": 0 }, "wind": { "speed": 0.98, "deg": 323 }, "visibility": 10000, "pop": 0, "sys": { "pod": "d" }, "dt_txt": "2020-11-12 09:00:00" }], "city": { "id": 1273294, "name": "Delhi", "coord": { "lat": 28.6667, "lon": 77.2167 }, "country": "IN", "population": 10927986, "timezone": 19800, "sunrise": 1604711265, "sunset": 1604750515 }
}
var dt_val = '0000-0'
var we = []
weather.list.map(obj => {
var first_of_date_txt = obj.dt_txt.split(" ")
if (!(first_of_date_txt[0].localeCompare(dt_val) == 0)) {
dt_val = first_of_date_txt[0];
// console.log(obj.weather[0].main)
we.push(obj);
}
})
console.log(we)