Skip to content

Commit f83ebab

Browse files
committed
Revert "Fix UTC to local time conversion error in DisplayForecastWeather for some examples."
This reverts commit b9e620d.
1 parent b9e620d commit f83ebab

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

examples/M5_CoreInk/M5_CoreInk.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ void DisplayForecastWeather(int x, int y, int offset, int index) {
206206
display.drawRect(x, y, offset, 65, GxEPD_BLACK);
207207
display.drawLine(x, y + 13, x + offset, y + 13, GxEPD_BLACK);
208208
DisplayWxIcon(x + offset / 2 + 1, y + 35, WxForecast[index].Icon, SmallIcon);
209-
drawString(x + offset / 2, y + 3, String(ConvertUnixTime(WxForecast[index].Dt).substring(0,5)), CENTER);
209+
drawString(x + offset / 2, y + 3, String(ConvertUnixTime(WxForecast[index].Dt + WxConditions[0].Timezone).substring(0,5)), CENTER);
210210
drawString(x + offset / 2, y + 50, String(WxForecast[index].High, 0) + "/" + String(WxForecast[index].Low, 0), CENTER);
211211
}
212212
//#########################################################################################

examples/Waveshare_1_54/Waveshare_1_54.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ void DisplayForecastWeather(int x, int y, int offset, int index) {
208208
display.drawRect(x, y, offset, 65, GxEPD_BLACK);
209209
display.drawLine(x, y + 13, x + offset, y + 13, GxEPD_BLACK);
210210
DisplayWxIcon(x + offset / 2 + 1, y + 35, WxForecast[index].Icon, SmallIcon);
211-
drawString(x + offset / 2, y + 3, String(ConvertUnixTime(WxForecast[index].Dt).substring(0,5)), CENTER);
211+
drawString(x + offset / 2, y + 3, String(ConvertUnixTime(WxForecast[index].Dt + WxConditions[0].Timezone).substring(0,5)), CENTER);
212212
drawString(x + offset / 2, y + 50, String(WxForecast[index].High, 0) + "/" + String(WxForecast[index].Low, 0), CENTER);
213213
}
214214
//#########################################################################################

examples/Waveshare_4_2/Waveshare_4_2.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ void DrawForecastWeather(int x, int y, int index) {
212212
display.drawRect(x, y, 55, 65, GxEPD_BLACK);
213213
display.drawLine(x + 1, y + 13, x + 54, y + 13, GxEPD_BLACK);
214214
DisplayWXicon(x + 28, y + 35, WxForecast[index].Icon, SmallIcon);
215-
drawString(x + 31, y + 3, String(ConvertUnixTime(WxForecast[index].Dt).substring(0,5)), CENTER);
215+
drawString(x + 31, y + 3, String(ConvertUnixTime(WxForecast[index].Dt + WxConditions[0].Timezone).substring(0,5)), CENTER);
216216
drawString(x + 41, y + 52, String(WxForecast[index].High, 0) + "° / " + String(WxForecast[index].Low, 0) + "°", CENTER);
217217
}
218218
//#########################################################################################

examples/Waveshare_7_5/Waveshare_7_5.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ void DisplayForecastWeather(int x, int y, int index) {
267267
display.drawRect(x, y, fwidth - 1, 65, GxEPD_BLACK);
268268
display.drawLine(x, y + 13, x + fwidth - 3, y + 13, GxEPD_BLACK);
269269
DisplayConditionsSection(x + fwidth / 2, y + 35, WxForecast[index].Icon, SmallIcon);
270-
drawString(x + fwidth / 2, y + 3, String(ConvertUnixTime(WxForecast[index].Dt).substring(0,5)), CENTER);
270+
drawString(x + fwidth / 2, y + 3, String(ConvertUnixTime(WxForecast[index].Dt + WxConditions[0].Timezone).substring(0,5)), CENTER);
271271
drawString(x + fwidth / 2, y + 53, String(WxForecast[index].High, 0) + "°/" + String(WxForecast[index].Low, 0) + "°", CENTER);
272272
}
273273
//#########################################################################################

examples/Waveshare_7_5_T7/Waveshare_7_5_T7.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ void DisplayForecastWeather(int x, int y, int index) {
268268
display.drawRect(x, y, fwidth - 1, 81, GxEPD_BLACK);
269269
display.drawLine(x, y + 16, x + fwidth - 3, y + 16, GxEPD_BLACK);
270270
DisplayConditionsSection(x + fwidth / 2, y + 43, WxForecast[index].Icon, SmallIcon);
271-
drawString(x + fwidth / 2, y + 4, String(ConvertUnixTime(WxForecast[index].Dt).substring(0,5)), CENTER);
271+
drawString(x + fwidth / 2, y + 4, String(ConvertUnixTime(WxForecast[index].Dt + WxConditions[0].Timezone).substring(0,5)), CENTER);
272272
drawString(x + fwidth / 2 + 12, y + 66, String(WxForecast[index].High, 0) + "°/" + String(WxForecast[index].Low, 0) + "°", CENTER);
273273
}
274274
//#########################################################################################

examples/Waveshare_9_7/Waveshare_9_7.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ void DisplayForecastWeather(int x, int y, int index) {
359359
display.drawLine(x, y + 40, x + fwidth - 3, y + 40, GxEPD_BLACK);
360360
DisplayConditionsSection(x + fwidth / 2, y + 90, WxForecast[index].Icon, SmallIcon);
361361
u8g2Fonts.setFont(u8g2_font_helvB14_tf);
362-
drawString(x + fwidth / 2 - 10, y + 20, String(ConvertUnixTime(WxForecast[index].Dt).substring(0,5)), CENTER);
362+
drawString(x + fwidth / 2 - 10, y + 20, String(ConvertUnixTime(WxForecast[index].Dt + WxConditions[0].Timezone).substring(0,5)), CENTER);
363363
drawString(x + fwidth / 2 + 0, y + 130, String(WxForecast[index].High, 0) + "°/" + String(WxForecast[index].Low, 0) + "°", CENTER);
364364
}
365365
//#########################################################################################

0 commit comments

Comments
 (0)