[Issue 1105] Add Parameter "format" to scroll list cells to define how a date cell will format its displayed date

Defaults to use RFC1123 to maintain expected behavior
This commit is contained in:
Inusaito Sayori
2013-09-19 23:29:36 -04:00
parent ae38835959
commit 892d224b9c
2 changed files with 5 additions and 1 deletions

View File

@@ -438,13 +438,14 @@ void LLScrollListCheck::setEnabled(BOOL enable)
LLScrollListDate::LLScrollListDate( const LLScrollListCell::Params& p)
: LLScrollListText(p),
mFormat(p.format),
mDate(p.value().asDate())
{}
void LLScrollListDate::setValue(const LLSD& value)
{
mDate = value.asDate();
LLScrollListText::setValue(mDate.asRFC1123());
LLScrollListText::setValue(mFormat.empty() ? mDate.asRFC1123() : mDate.toHTTPDateString(mFormat));
}
const LLSD LLScrollListDate::getValue() const

View File

@@ -61,6 +61,7 @@ public:
Optional<void*> userdata;
Optional<LLSD> value;
Optional<std::string> tool_tip;
Optional<std::string> format;
Optional<std::string> font;
Optional<LLColor4> font_color;
@@ -77,6 +78,7 @@ public:
visible("visible", true),
value("value"),
tool_tip("tool_tip", ""),
format("format", ""),
font("font"/*, LLFontGL::getFontSansSerifSmall()*/),
font_color("font_color", LLColor4::black),
font_style("font-style"),
@@ -230,6 +232,7 @@ public:
virtual const LLSD getValue() const;
private:
std::string mFormat;
LLDate mDate;
};