summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelenvironment.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-10-22 14:46:15 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-10-22 14:46:15 -0400
commitbfe759584f63c0587a2dc6a0086ad9d5b6c63a56 (patch)
tree84653a1211908c7dd2ce5bc4877e79f8e6515099 /indra/newview/llpanelenvironment.cpp
parent62fc3ceaf5251458239f91192a05edc64bedf33b (diff)
parent394f7b37f2ec05c7cfb32c350432886f1c493c85 (diff)
Merge branch 'develop' into marchcat/xcode-16
Diffstat (limited to 'indra/newview/llpanelenvironment.cpp')
-rw-r--r--indra/newview/llpanelenvironment.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp
index be61c44b7c..d3df88b65e 100644
--- a/indra/newview/llpanelenvironment.cpp
+++ b/indra/newview/llpanelenvironment.cpp
@@ -48,6 +48,7 @@
#include "llappviewer.h"
#include "llcallbacklist.h"
+#include "llviewercontrol.h"
#include "llviewerparcelmgr.h"
#include "llinventorymodel.h"
@@ -939,19 +940,29 @@ void LLPanelEnvironmentInfo::udpateApparentTimeOfDay()
S32Hours hourofday(secondofday);
S32Seconds secondofhour(secondofday - hourofday);
S32Minutes minutesofhour(secondofhour);
+ static bool use_24h = gSavedSettings.getBOOL("Use24HourClock");
bool am_pm(hourofday.value() >= 12);
- if (hourofday.value() < 1)
- hourofday = S32Hours(12);
- if (hourofday.value() > 12)
- hourofday -= S32Hours(12);
+ if (!use_24h)
+ {
+ if (hourofday.value() < 1)
+ hourofday = S32Hours(12);
+ if (hourofday.value() > 12)
+ hourofday -= S32Hours(12);
+ }
std::string lblminute(((minutesofhour.value() < 10) ? "0" : "") + LLSD(minutesofhour.value()).asString());
-
mLabelApparentTime->setTextArg("[HH]", LLSD(hourofday.value()).asString());
mLabelApparentTime->setTextArg("[MM]", lblminute);
- mLabelApparentTime->setTextArg("[AP]", std::string(am_pm ? "PM" : "AM"));
+ if (use_24h)
+ {
+ mLabelApparentTime->setTextArg("[AP]", std::string());
+ }
+ else
+ {
+ mLabelApparentTime->setTextArg("[AP]", std::string(am_pm ? "PM" : "AM"));
+ }
mLabelApparentTime->setTextArg("[PRC]", LLSD((S32)(100 * perc)).asString());
}