Use PST/PDT when logged into OpenSim instead of SLT

master
Hecklezz 2025-08-27 20:32:24 +10:00
parent 2d22a26753
commit 180ebf3a32
3 changed files with 22 additions and 2 deletions

View File

@ -1070,6 +1070,7 @@ std::optional<std::string> llstring_getoptenv(const std::string& key)
long LLStringOps::sPacificTimeOffset = 0;
long LLStringOps::sLocalTimeOffset = 0;
bool LLStringOps::sPacificDaylightTime = 0;
bool LLStringOps::sUsingPacificTime = false; // <FS:TJ/> [FIRE-34775] Use PST/PDT when logged into OpenSim
std::map<std::string, std::string> LLStringOps::datetimeToCodes;
std::vector<std::string> LLStringOps::sWeekDayList;
@ -1628,12 +1629,21 @@ bool LLStringUtil::formatDatetime(std::string& replacement, std::string token,
}
else
{
#if 0
// <FS:TJ> [FIRE-34775] Use PST/PDT when logged into OpenSim
#ifdef OPENSIM
// EXT-1565 : Zai Lynch, James Linden : 15/Oct/09
// [BSI] Feedback: Viewer clock mentions SLT, but would prefer it to show PST/PDT
// "slt" = Second Life Time, which is deprecated.
// If not utc or user local time, fallback to Pacific time
replacement = LLStringOps::getPacificDaylightTime() ? "PDT" : "PST";
if (LLStringOps::getUsingPacificTime())
{
replacement = LLStringOps::getPacificDaylightTime() ? "PDT" : "PST";
}
else
{
replacement = "SLT";
}
// </FS:TJ>
#else
// SL-20370 : Steeltoe Linden : 29/Sep/23
// Change "PDT" to "SLT" on menu bar

View File

@ -153,6 +153,7 @@ private:
static long sPacificTimeOffset;
static long sLocalTimeOffset;
static bool sPacificDaylightTime;
static bool sUsingPacificTime; // <FS:TJ/> [FIRE-34775] Use PST/PDT when logged into OpenSim
static std::map<std::string, std::string> datetimeToCodes;
@ -204,6 +205,9 @@ public:
static S32 collate(const llwchar* a, const llwchar* b);
static void setupDatetimeInfo(bool pacific_daylight_time);
// <FS:TJ> [FIRE-34775] Use PST/PDT when logged into OpenSim
static void setupUsingPacificTime(bool use_pacific_time) { sUsingPacificTime = use_pacific_time; }
// </FS:TJ>
static void setupWeekDaysNames(const std::string& data);
static void setupWeekDaysShortNames(const std::string& data);
@ -217,6 +221,9 @@ public:
// Is the Pacific time zone (aka server time zone)
// currently in daylight savings time?
static bool getPacificDaylightTime(void) { return sPacificDaylightTime;}
// <FS:TJ> [FIRE-34775] Use PST/PDT when logged into OpenSim
static bool getUsingPacificTime() { return sUsingPacificTime; }
// </FS:TJ>
static std::string getDatetimeCode (std::string key);

View File

@ -4871,6 +4871,9 @@ bool process_login_success_response(U32 &first_sim_size_x, U32 &first_sim_size_y
//setup map of datetime strings to codes and slt & local time offset from utc
LLStringOps::setupDatetimeInfo(pacific_daylight_time);
// <FS:TJ> [FIRE-34775] Use PST/PDT when logged into OpenSim
LLStringOps::setupUsingPacificTime(LLGridManager::getInstance()->isInOpenSim());
// </FS:TJ>
}
// set up the voice configuration. Ultimately, we should pass this up as part of each voice