From f7ae554394fe7518bfba6da888a23ac9413d5b4d Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Tue, 15 Sep 2020 12:02:27 +0200 Subject: [PATCH] Allow display of date in US format Allow display of date in US format (#9260) --- tasmota/xdrv_13_display.ino | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tasmota/xdrv_13_display.ino b/tasmota/xdrv_13_display.ino index 8a0c5d395..7b5b34054 100644 --- a/tasmota/xdrv_13_display.ino +++ b/tasmota/xdrv_13_display.ino @@ -624,12 +624,19 @@ void DisplayText(void) } } break; - case 'T': + case 'T': { + uint8_t param1 = RtcTime.day_of_month; + uint8_t param2 = RtcTime.month; + if (*cp=='U') { + cp++; + param1 = RtcTime.month; + param2 = RtcTime.day_of_month; + } if (dp < (linebuf + DISPLAY_BUFFER_COLS) -8) { - snprintf_P(dp, 9, PSTR("%02d" D_MONTH_DAY_SEPARATOR "%02d" D_YEAR_MONTH_SEPARATOR "%02d"), RtcTime.day_of_month, RtcTime.month, RtcTime.year%2000); + snprintf_P(dp, 9, PSTR("%02d" D_MONTH_DAY_SEPARATOR "%02d" D_YEAR_MONTH_SEPARATOR "%02d"), param1, param2, RtcTime.year%2000); dp += 8; } - break; + break; } case 'd': // force draw grafics buffer if (renderer) renderer->Updateframe();