diff options
| author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2021-12-07 01:50:39 +0200 | 
|---|---|---|
| committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2021-12-07 13:41:34 +0200 | 
| commit | a8441da019a327ac461d953dbe872d0121a4117d (patch) | |
| tree | f7c4eca1a3d8b711a6e4f5505b30021bf8ce6523 /indra/newview | |
| parent | 37526c40a8714119a9402fbaf4c8c97b402b0ad6 (diff) | |
SL-16450 Fix LLEventNotifier not expecting ISO date
Diffstat (limited to 'indra/newview')
| -rw-r--r-- | indra/newview/lleventnotifier.cpp | 37 | 
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()); +        }  	}  } | 
