summaryrefslogtreecommitdiff
path: root/indra/newview/lleventnotifier.cpp
diff options
context:
space:
mode:
authorEuclid Linden <euclid@lindenlab.com>2022-04-18 21:56:26 +0000
committerEuclid Linden <euclid@lindenlab.com>2022-04-18 21:56:26 +0000
commite71201ac125cab5f3d3cf7d6a30500253fc29d90 (patch)
tree270e46eb85dd46fb6962a36a9357dbf31c3afb29 /indra/newview/lleventnotifier.cpp
parent2d63d2044e0a00d1969c3da254e016a6e520c0d5 (diff)
parent035b1996df3f357b5060e3eb778588da5b9e7b37 (diff)
Merged in DV528-merge-6.5.5 (pull request #945)
DRTVWR-528 merge up to 6.5.5
Diffstat (limited to 'indra/newview/lleventnotifier.cpp')
-rw-r--r--indra/newview/lleventnotifier.cpp37
1 files changed, 35 insertions, 2 deletions
diff --git a/indra/newview/lleventnotifier.cpp b/indra/newview/lleventnotifier.cpp
index e3c17f9877..f1a44a68c9 100644
--- a/indra/newview/lleventnotifier.cpp
+++ b/indra/newview/lleventnotifier.cpp
@@ -36,6 +36,7 @@
#include "llfloaterevent.h"
#include "llagent.h"
#include "llcommandhandler.h" // secondlife:///app/... support
+#include "lltrans.h"
class LLEventHandler : public LLCommandHandler
{
@@ -218,8 +219,40 @@ void LLEventNotifier::load(const LLSD& event_options)
end = event_options.endArray(); resp_it != end; ++resp_it)
{
LLSD response = *resp_it;
-
- add(response["event_id"].asInteger(), response["event_date_ut"], response["event_date"].asString(), response["event_name"].asString());
+ LLDate date;
+ bool is_iso8601_date = false;
+
+ if (response["event_date"].isDate())
+ {
+ date = response["event_date"].asDate();
+ is_iso8601_date = true;
+ }
+ else if (date.fromString(response["event_date"].asString()))
+ {
+ is_iso8601_date = true;
+ }
+
+ if (is_iso8601_date)
+ {
+ std::string dateStr;
+
+ dateStr = "[" + LLTrans::getString("LTimeYear") + "]-["
+ + LLTrans::getString("LTimeMthNum") + "]-["
+ + LLTrans::getString("LTimeDay") + "] ["
+ + LLTrans::getString("LTimeHour") + "]:["
+ + LLTrans::getString("LTimeMin") + "]:["
+ + LLTrans::getString("LTimeSec") + "]";
+
+ LLSD substitution;
+ substitution["datetime"] = date;
+ LLStringUtil::format(dateStr, substitution);
+
+ add(response["event_id"].asInteger(), response["event_date_ut"], dateStr, response["event_name"].asString());
+ }
+ else
+ {
+ add(response["event_id"].asInteger(), response["event_date_ut"], response["event_date"].asString(), response["event_name"].asString());
+ }
}
}