diff options
| author | James Cook <james@lindenlab.com> | 2010-04-20 16:06:25 -0700 |
|---|---|---|
| committer | James Cook <james@lindenlab.com> | 2010-04-20 16:06:25 -0700 |
| commit | 257c3ed2a3747256500f704f6e06e7631af3c08e (patch) | |
| tree | 7652d6a9844f23c32ee305d8d85e707224c7e332 /indra/newview/lldateutil.cpp | |
| parent | 6d1e44b0338dd2815f605a5ba6e6528932cf3ebc (diff) | |
LLDateUtil::ageFromDate() now takes more sensible parameters
This and last reviewed with Kelly
Diffstat (limited to 'indra/newview/lldateutil.cpp')
| -rw-r--r-- | indra/newview/lldateutil.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/indra/newview/lldateutil.cpp b/indra/newview/lldateutil.cpp index 1a13cd05fd..32b8b9662a 100644 --- a/indra/newview/lldateutil.cpp +++ b/indra/newview/lldateutil.cpp @@ -59,8 +59,10 @@ static S32 days_from_month(S32 year, S32 month) } } -static std::string age_from_date(S32 born_year, S32 born_month, S32 born_day, - const LLDate& now) +std::string LLDateUtil::ageFromDate(S32 born_year, + S32 born_month, + S32 born_day, + const LLDate& now) { LLDate born_date; born_date.fromYMDHMS(born_year, born_month, born_day); @@ -158,7 +160,7 @@ std::string LLDateUtil::ageFromDate(const std::string& date_string, 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 "???"; - return age_from_date(born_year, born_month, born_day, now); + return ageFromDate(born_year, born_month, born_day, now); } std::string LLDateUtil::ageFromDate(const std::string& date_string) @@ -173,15 +175,10 @@ std::string LLDateUtil::ageFromDateISO(const std::string& date_string, S32 matched = sscanf(date_string.c_str(), "%d-%d-%d", &born_year, &born_month, &born_day); if (matched != 3) return "???"; - return age_from_date(born_year, born_month, born_day, now); + return ageFromDate(born_year, born_month, born_day, now); } std::string LLDateUtil::ageFromDateISO(const std::string& date_string) { return ageFromDateISO(date_string, LLDate::now()); } - -std::string LLDateUtil::ageFromDate(S32 year, S32 month, S32 day) -{ - return age_from_date(year, month, day, LLDate::now()); -} |
