Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
c4298c4f
Commit
c4298c4f
authored
15 years ago
by
James Cook
Browse files
Options
Downloads
Patches
Plain Diff
Remove unused date code after review with Leyla. Will unbreak Mac build.
parent
fc04d5bb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/newview/lldateutil.cpp
+0
-41
0 additions, 41 deletions
indra/newview/lldateutil.cpp
with
0 additions
and
41 deletions
indra/newview/lldateutil.cpp
+
0
−
41
View file @
c4298c4f
...
@@ -37,35 +37,6 @@
...
@@ -37,35 +37,6 @@
#include
"lltrans.h"
#include
"lltrans.h"
#include
"llui.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
[]
=
static
S32
DAYS_PER_MONTH_NOLEAP
[]
=
{
31
,
28
,
21
,
30
,
31
,
30
,
31
,
31
,
30
,
31
,
30
,
31
};
{
31
,
28
,
21
,
30
,
31
,
30
,
31
,
31
,
30
,
31
,
30
,
31
};
static
S32
DAYS_PER_MONTH_LEAP
[]
=
static
S32
DAYS_PER_MONTH_LEAP
[]
=
...
@@ -88,17 +59,6 @@ static S32 days_from_month(S32 year, S32 month)
...
@@ -88,17 +59,6 @@ static S32 days_from_month(S32 year, S32 month)
std
::
string
LLDateUtil
::
ageFromDate
(
const
std
::
string
&
date_string
,
std
::
string
LLDateUtil
::
ageFromDate
(
const
std
::
string
&
date_string
,
const
LLDate
&
now
)
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
born_month
,
born_day
,
born_year
;
S32
matched
=
sscanf
(
date_string
.
c_str
(),
"%d/%d/%d"
,
&
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
"???"
;
if
(
matched
!=
3
)
return
"???"
;
...
@@ -135,7 +95,6 @@ std::string LLDateUtil::ageFromDate(const std::string& date_string,
...
@@ -135,7 +95,6 @@ std::string LLDateUtil::ageFromDate(const std::string& date_string,
age_months
+=
12
;
age_months
+=
12
;
}
}
S32
age_years
=
(
now_year
-
born_year
);
S32
age_years
=
(
now_year
-
born_year
);
#endif
// Noun pluralization depends on language
// Noun pluralization depends on language
std
::
string
lang
=
LLUI
::
getLanguage
();
std
::
string
lang
=
LLUI
::
getLanguage
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment