Kiosk: show all user-visible times as 12-hour AM/PM

Add datetime::formatHm12h/formatTime12h and use them for the Home footer
clock, the Timezone page's local-time sample, and the log viewer
timestamps. Storage and parsing remain 24-hour HH:MM. Extends the
date-format tests with the midnight/noon edge cases.
This commit is contained in:
NeilClack
2026-09-29 08:43:59 -05:00
parent 336f47c6ac
commit 59b499037b
6 changed files with 113 additions and 3 deletions
+6 -1
View File
@@ -1,5 +1,6 @@
#include "log_viewer_page.h"
#include "app_state.h"
#include "date_format.h"
#include "timezone_helper.h"
#include "logical_size.h"
#include <SDL3/SDL.h>
@@ -256,7 +257,11 @@ void LogViewerPage::rebuildWrapped(float maxLineWidth) {
using namespace radiantwave::logger;
for (const auto& entry : rawEntries_) {
std::string timeStr = radiantwave::timezone::formatUtcToTimezone(entry.timestamp, currentTzCode_, "%Y-%m-%d %H:%M:%S");
std::string timeStr =
radiantwave::timezone::formatUtcToTimezone(entry.timestamp, currentTzCode_, "%Y-%m-%d") +
" " +
radiantwave::datetime::formatHm12h(
radiantwave::timezone::formatUtcToTimezone(entry.timestamp, currentTzCode_, "%H:%M"));
std::string fullLineStr = "[" + timeStr + "] [" + std::string(logLevelToString(entry.level)) + "] [" + entry.component + "] " + entry.message;