feat(util): app-wide 24h/12h clock format

Add util::formatClockDateTime/formatClockTime driven by a process-wide flag (setClock12h,
synced from the time_format setting each frame). Switch the primary user-facing timestamp
displays to it — the transaction list, wallet-state tx + banned-peer times, the explorer
block time, and the block-info dialog — so one preference drives every clock.

Log files, export filenames/content, console line prefixes, the market chart axis, and the
worker-thread "last updated" string intentionally stay fixed 24h.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-17 18:44:44 -05:00
parent acde8c0833
commit 8d8cd337cf
6 changed files with 50 additions and 26 deletions

View File

@@ -1127,10 +1127,8 @@ static void renderBlockDetailModal(App* app) {
// Row 1: Timestamp | Confirmations
drawLabelValue(dl, gx, gy, labelW, TR("block_timestamp"), "", capFont, sub1);
if (s_detail_time > 0) {
std::time_t t = static_cast<std::time_t>(s_detail_time);
char time_buf[64];
std::strftime(time_buf, sizeof(time_buf), "%Y-%m-%d %H:%M:%S", std::localtime(&t));
dl->AddText(sub1, sub1->LegacySize, ImVec2(gx + labelW, gy), OnSurface(), time_buf);
const std::string tstr = dragonx::util::formatClockDateTime(s_detail_time, /*withSeconds=*/true);
dl->AddText(sub1, sub1->LegacySize, ImVec2(gx + labelW, gy), OnSurface(), tstr.c_str());
}
dl->AddText(capFont, capFont->LegacySize, ImVec2(gx + halfW, gy), OnSurfaceMedium(), TR("confirmations"));
snprintf(buf, sizeof(buf), "%d", s_detail_confirmations);