Skip to content

Commit 9d874b5

Browse files
committed
more forecast at once in tui
1 parent d624750 commit 9d874b5

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tui/src/weather.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ impl Widget for &WeatherComponent {
151151
Line::from(separator.clone()).centered(),
152152
Line::from("Forecast".bold()).centered(),
153153
Line::from(format!("{:6} Min | Max | UV | F Min | F Max", "Date")).centered(),
154+
Line::from("-----------|-----|------|-------|------").centered(),
154155
Line::from(match forecast.get(self.current_forecast_day as usize) {
155156
Some(f) => format!(
156157
"{:6} {:3.0} | {:3.0} | {:1.2} | {:3.0} | {:3.0}",
@@ -175,6 +176,18 @@ impl Widget for &WeatherComponent {
175176
),
176177
None => "No forecast available".to_string(),
177178
}).centered(),
179+
Line::from(match forecast.get((self.current_forecast_day as usize + 2) % 7) {
180+
Some(f) => format!(
181+
"{:6} {:3.0} | {:3.0} | {:1.2} | {:3.0} | {:3.0}",
182+
f.time.format("%a %d"),
183+
f.temperature_2m_min,
184+
f.temperature_2m_max,
185+
f.uv_index_max,
186+
f.apparent_temperature_min,
187+
f.apparent_temperature_max
188+
),
189+
None => "No forecast available".to_string(),
190+
}).centered(),
178191
Line::from(separator.clone()).centered(),
179192
Line::from("🌕 Day time ☀️".bold()).centered(),
180193
Line::from(""),

0 commit comments

Comments
 (0)