summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2009-11-20 10:25:02 -0800
committerJames Cook <james@lindenlab.com>2009-11-20 10:25:02 -0800
commitc4298c4f378e90bffd13f81f33048483e49319fc (patch)
tree7598a2fef3587a9e936991691c481400b24222fa /indra
parentfc04d5bbb8b51b9ca39d1a3a1de0991de09cdb58 (diff)
Remove unused date code after review with Leyla. Will unbreak Mac build.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/lldateutil.cpp41
1 files changed, 0 insertions, 41 deletions
diff --git a/indra/newview/lldateutil.cpp b/indra/newview/lldateutil.cpp
index 1fe1715995..10b7935caf 100644
--- a/indra/newview/lldateutil.cpp
+++ b/indra/newview/lldateutil.cpp
@@ -37,35 +37,6 @@
#include "lltrans.h"
#include "llui.h"
-static S32 age_days_from_date(const std::string& date_string,
- const LLDate& now)
-{
- // Convert string date to malleable representation
- S32 month, day, year;
- S32 matched = sscanf(date_string.c_str(), "%d/%d/%d", &month, &day, &year);
- if (matched != 3) return S32_MIN;
-
- // Create ISO-8601 date string
- std::string iso8601_date_string =
- llformat("%04d-%02d-%02dT00:00:00Z", year, month, day);
- LLDate date(iso8601_date_string);
-
- // Correct for the fact that account creation dates are in Pacific time,
- // == UTC - 8
- F64 date_secs_since_epoch = date.secondsSinceEpoch();
- date_secs_since_epoch += 8.0 * 60.0 * 60.0;
-
- // Convert seconds from epoch to seconds from now
- F64 now_secs_since_epoch = now.secondsSinceEpoch();
- F64 age_secs = now_secs_since_epoch - date_secs_since_epoch;
-
- // We don't care about sub-day times
- const F64 SEC_PER_DAY = 24.0 * 60.0 * 60.0;
- S32 age_days = lltrunc(age_secs / SEC_PER_DAY);
-
- return age_days;
-}
-
static S32 DAYS_PER_MONTH_NOLEAP[] =
{ 31, 28, 21, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
static S32 DAYS_PER_MONTH_LEAP[] =
@@ -88,17 +59,6 @@ static S32 days_from_month(S32 year, S32 month)
std::string LLDateUtil::ageFromDate(const std::string& date_string,
const LLDate& now)
{
-#define BAD_DATE_MATH 0
-#if BAD_DATE_MATH
- S32 age_days = age_days_from_date(date_string, now);
- if (age_days == S32_MIN) return "???";
- S32 age_years = age_days / 365;
- age_days = age_days % 365;
- // *NOTE: This is wrong. Not all months have 30 days, but we don't have a library
- // for relative date arithmetic. :-( JC
- S32 age_months = age_days / 30;
- age_days = age_days % 30;
-#else
S32 born_month, born_day, born_year;
S32 matched = sscanf(date_string.c_str(), "%d/%d/%d", &born_month, &born_day, &born_year);
if (matched != 3) return "???";
@@ -135,7 +95,6 @@ std::string LLDateUtil::ageFromDate(const std::string& date_string,
age_months += 12;
}
S32 age_years = (now_year - born_year);
-#endif
// Noun pluralization depends on language
std::string lang = LLUI::getLanguage();