Add in an option for YYYY/MM/DD, for the classical log stampies

Cleanup that prefs code, too!
This commit is contained in:
Lirusaito
2019-07-22 10:09:14 -04:00
parent 189590edb9
commit 4cb43c6747
2 changed files with 18 additions and 21 deletions

View File

@@ -126,36 +126,32 @@ void LLPrefsAscentChat::onCommitTimeDate(LLUICtrl* ctrl)
std::string short_date, long_date, short_time, long_time, timestamp;
if (tempDateFormat < 3)
{
short_date = !tempDateFormat ? "%F" :
tempDateFormat == 1 ? "%Y/%m/%d" :
"%d/%m/%Y";
long_date = "%A %d %B %Y";
timestamp = "%a %d %b %Y";
}
else
{
short_date = "%m/%d/%Y";
long_date = "%A, %B %d %Y";
timestamp = "%a %b %d %Y";
}
if (tempTimeFormat == 0)
{
short_time = "%R";
long_time = "%T";
timestamp = " %T";
timestamp += " %T";
}
else
{
short_time = "%I:%M %p";
long_time = "%I:%M:%S %p";
timestamp = " %I:%M %p";
}
if (tempDateFormat == 0)
{
short_date = "%F";
long_date = "%A %d %B %Y";
timestamp = "%a %d %b %Y" + timestamp;
}
else if (tempDateFormat == 1)
{
short_date = "%d/%m/%Y";
long_date = "%A %d %B %Y";
timestamp = "%a %d %b %Y" + timestamp;
}
else
{
short_date = "%m/%d/%Y";
long_date = "%A, %B %d %Y";
timestamp = "%a %b %d %Y" + timestamp;
timestamp += " %I:%M %p";
}
gSavedSettings.setString("ShortDateFormat", short_date);

View File

@@ -42,6 +42,7 @@
<text bottom_delta="-18" left="10" follows="top" name="date_format_text_box">Date format:</text>
<combo_box bottom_delta="-5" left="90" follows="top" height="18" name="date_format_combobox" width="130">
<combo_item name="year_first" value="default">YYYY-MM-DD</combo_item>
<combo_item name="year_first_slashes" value="default">YYYY/MM/DD</combo_item>
<combo_item name="day_first" value="default">DD/MM/YYYY</combo_item>
<combo_item name="month_first" value="default">MM/DD/YYYY</combo_item>
</combo_box>