From 344dc90d56412c840354df30c2198d8049ee8e87 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sun, 31 Mar 2019 03:13:02 -0400 Subject: [PATCH] Use C++11 time format flags --- indra/newview/app_settings/settings.xml | 8 ++++---- indra/newview/ascentprefschat.cpp | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index fc68ebc42..e1b251023 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7045,7 +7045,7 @@ This should be as low as possible, but too low may break functionality Type String Value - %Y-%m-%d + %F ShortTimeFormat @@ -7056,7 +7056,7 @@ This should be as low as possible, but too low may break functionality Type String Value - %H:%M + %R LongTimeFormat @@ -7067,7 +7067,7 @@ This should be as low as possible, but too low may break functionality Type String Value - %H:%M:%S + %T TimestampFormat @@ -7078,7 +7078,7 @@ This should be as low as possible, but too low may break functionality Type String Value - %a %d %b %Y %H:%M:%S + %a %d %b %Y %T SecondsInChatAndIMs diff --git a/indra/newview/ascentprefschat.cpp b/indra/newview/ascentprefschat.cpp index 141b57dcd..150c9a3a4 100644 --- a/indra/newview/ascentprefschat.cpp +++ b/indra/newview/ascentprefschat.cpp @@ -128,9 +128,9 @@ void LLPrefsAscentChat::onCommitTimeDate(LLUICtrl* ctrl) if (tempTimeFormat == 0) { - short_time = "%H:%M"; - long_time = "%H:%M:%S"; - timestamp = " %H:%M:%S"; + short_time = "%R"; + long_time = "%T"; + timestamp = " %T"; } else { @@ -141,7 +141,7 @@ void LLPrefsAscentChat::onCommitTimeDate(LLUICtrl* ctrl) if (tempDateFormat == 0) { - short_date = "%Y-%m-%d"; + short_date = "%F"; long_date = "%A %d %B %Y"; timestamp = "%a %d %b %Y" + timestamp; } @@ -153,7 +153,7 @@ void LLPrefsAscentChat::onCommitTimeDate(LLUICtrl* ctrl) } else { - short_date = "%m/%d/%Y"; + short_date = "%D"; long_date = "%A, %B %d %Y"; timestamp = "%a %b %d %Y" + timestamp; } @@ -218,11 +218,11 @@ void LLPrefsAscentChat::refreshValues() } format = gSavedSettings.getString("ShortDateFormat"); - if (format.find("%m/%d/%") != std::string::npos) + if (format.find("%D") != std::string::npos || format.find("%m/%d/%") != std::string::npos) { mDateFormat = 2; } - else if (format.find("%d/%m/%") != -1) + else if (format.find("%d/%m/%") != std::string::npos) { mDateFormat = 1; }