From 4cb43c6747111b7da75afe876ecdd725e8f4d266 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Mon, 22 Jul 2019 10:09:14 -0400 Subject: [PATCH] Add in an option for YYYY/MM/DD, for the classical log stampies Cleanup that prefs code, too! --- indra/newview/ascentprefschat.cpp | 38 +++++++++---------- .../en-us/panel_preferences_ascent_chat.xml | 1 + 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/indra/newview/ascentprefschat.cpp b/indra/newview/ascentprefschat.cpp index f58b032e4..8a408fa1e 100644 --- a/indra/newview/ascentprefschat.cpp +++ b/indra/newview/ascentprefschat.cpp @@ -126,36 +126,32 @@ void LLPrefsAscentChat::onCommitTimeDate(LLUICtrl* ctrl) std::string short_date, long_date, short_time, long_time, timestamp; + if (tempDateFormat < 3) + { + short_date = !tempDateFormat ? "%F" : + tempDateFormat == 1 ? "%Y/%m/%d" : + "%d/%m/%Y"; + long_date = "%A %d %B %Y"; + timestamp = "%a %d %b %Y"; + } + else + { + short_date = "%m/%d/%Y"; + long_date = "%A, %B %d %Y"; + timestamp = "%a %b %d %Y"; + } + if (tempTimeFormat == 0) { short_time = "%R"; long_time = "%T"; - timestamp = " %T"; + timestamp += " %T"; } else { short_time = "%I:%M %p"; long_time = "%I:%M:%S %p"; - timestamp = " %I:%M %p"; - } - - if (tempDateFormat == 0) - { - short_date = "%F"; - long_date = "%A %d %B %Y"; - timestamp = "%a %d %b %Y" + timestamp; - } - else if (tempDateFormat == 1) - { - short_date = "%d/%m/%Y"; - long_date = "%A %d %B %Y"; - timestamp = "%a %d %b %Y" + timestamp; - } - else - { - short_date = "%m/%d/%Y"; - long_date = "%A, %B %d %Y"; - timestamp = "%a %b %d %Y" + timestamp; + timestamp += " %I:%M %p"; } gSavedSettings.setString("ShortDateFormat", short_date); diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml index 3c64e70e2..d3b6bd71a 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml @@ -42,6 +42,7 @@ Date format: YYYY-MM-DD + YYYY/MM/DD DD/MM/YYYY MM/DD/YYYY