summaryrefslogtreecommitdiff
path: root/indra/newview/llnotificationlistitem.cpp
diff options
context:
space:
mode:
authorMnikolenko ProductEngine <mnikolenko@productengine.com>2015-07-16 13:19:14 +0300
committerMnikolenko ProductEngine <mnikolenko@productengine.com>2015-07-16 13:19:14 +0300
commit8b498ab961f14cfb03834422c4b2b33a91f91f6e (patch)
tree2b339b73517d10af3f0cd8b58ad92490cd66ee02 /indra/newview/llnotificationlistitem.cpp
parent9131f7705974c84127bcc3109d2ab1c56cb1f009 (diff)
MAINT-5396 FIXED Group notice timestamps are no longer GMT
Diffstat (limited to 'indra/newview/llnotificationlistitem.cpp')
-rw-r--r--indra/newview/llnotificationlistitem.cpp42
1 files changed, 33 insertions, 9 deletions
diff --git a/indra/newview/llnotificationlistitem.cpp b/indra/newview/llnotificationlistitem.cpp
index 23a2399ed3..ddbc5f3916 100644
--- a/indra/newview/llnotificationlistitem.cpp
+++ b/indra/newview/llnotificationlistitem.cpp
@@ -99,14 +99,35 @@ LLNotificationListItem::~LLNotificationListItem()
}
//static
-std::string LLNotificationListItem::buildNotificationDate(const LLDate& time_stamp)
+std::string LLNotificationListItem::buildNotificationDate(const LLDate& time_stamp, ETimeType time_type)
{
- std::string timeStr = "[" + LLTrans::getString("LTimeMthNum") + "]/["
- +LLTrans::getString("LTimeDay")+"]/["
- +LLTrans::getString("LTimeYear")+"] ["
- +LLTrans::getString("LTimeHour")+"]:["
- +LLTrans::getString("LTimeMin")+"]";
-
+ std::string timeStr;
+ switch(time_type)
+ {
+ case Local:
+ timeStr = "[" + LLTrans::getString("LTimeMthNum") + "]/["
+ +LLTrans::getString("LTimeDay")+"]/["
+ +LLTrans::getString("LTimeYear")+"] ["
+ +LLTrans::getString("LTimeHour")+"]:["
+ +LLTrans::getString("LTimeMin")+ "]";
+ break;
+ case UTC:
+ timeStr = "[" + LLTrans::getString("UTCTimeMth") + "]/["
+ +LLTrans::getString("UTCTimeDay")+"]/["
+ +LLTrans::getString("UTCTimeYr")+"] ["
+ +LLTrans::getString("UTCTimeHr")+"]:["
+ +LLTrans::getString("UTCTimeMin")+"] ["
+ +LLTrans::getString("UTCTimeTimezone")+"]";
+ break;
+ case SLT:
+ default:
+ timeStr = "[" + LLTrans::getString("TimeMonth") + "]/["
+ +LLTrans::getString("TimeDay")+"]/["
+ +LLTrans::getString("TimeYear")+"] ["
+ +LLTrans::getString("TimeHour")+"]:["
+ +LLTrans::getString("TimeMin")+"]";
+ break;
+ }
LLSD substitution;
substitution["datetime"] = time_stamp;
LLStringUtil::format(timeStr, substitution);
@@ -330,11 +351,14 @@ BOOL LLGroupNoticeNotificationListItem::postBuild()
mTitleBox->setValue(mParams.subject);
mTitleBoxExp->setValue(mParams.subject);
mNoticeTextExp->setValue(mParams.message);
+
+ mTimeBox->setValue(buildNotificationDate(mParams.time_stamp, UTC));
+ mTimeBoxExp->setValue(buildNotificationDate(mParams.time_stamp, UTC));
//Workaround: in case server timestamp is 0 - we use the time when notification was actually received
if (mParams.time_stamp.isNull())
{
- mTimeBox->setValue(buildNotificationDate(mParams.received_time));
- mTimeBoxExp->setValue(buildNotificationDate(mParams.received_time));
+ mTimeBox->setValue(buildNotificationDate(mParams.received_time, UTC));
+ mTimeBoxExp->setValue(buildNotificationDate(mParams.received_time, UTC));
}
setSender(mParams.sender);