Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
InstiApp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
RAHUL SHARMA
InstiApp
Commits
32ff2f4a
Commit
32ff2f4a
authored
Oct 20, 2018
by
Sajal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Capitalise first letter of DateTime subtitle
parent
dd855122
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
app/src/main/java/app/insti/utils/DateTimeUtil.java
app/src/main/java/app/insti/utils/DateTimeUtil.java
+6
-8
No files found.
app/src/main/java/app/insti/utils/DateTimeUtil.java
View file @
32ff2f4a
...
...
@@ -17,7 +17,7 @@ public class DateTimeUtil {
long
minutes
=
TimeUnit
.
MILLISECONDS
.
toMinutes
(
now
.
getTime
()
-
date
.
getTime
());
long
hours
=
TimeUnit
.
MILLISECONDS
.
toHours
(
now
.
getTime
()
-
date
.
getTime
());
if
(
seconds
<=
0
)
{
return
"
n
ow"
;
return
"
N
ow"
;
}
else
if
(
seconds
<
60
&&
seconds
>
1
)
{
return
seconds
+
" seconds ago"
;
}
else
if
(
minutes
==
1
)
{
...
...
@@ -25,22 +25,20 @@ public class DateTimeUtil {
}
else
if
(
minutes
<
60
&&
minutes
>
1
)
{
return
minutes
+
" minutes ago"
;
}
else
if
(
hours
==
1
)
{
return
"
a
n hour ago"
;
return
"
A
n hour ago"
;
}
else
if
(
hours
<
24
&&
hours
>
1
)
{
return
hours
+
" hours ago"
;
}
else
{
long
days
=
Math
.
round
(
diff
/
(
24.0
*
60
*
60
*
1000
));
if
(
days
==
0
)
return
"
t
oday"
;
return
"
T
oday"
;
else
if
(
days
==
1
)
return
"yesterday"
;
else
if
(
days
==
1
)
return
"a day ago"
;
return
"Yesterday"
;
else
if
(
days
<
14
)
return
days
+
" days ago"
;
else
if
(
days
<
30
)
if
((
int
)
(
days
/
7
)
==
1
)
return
"
a
week ago"
;
return
"
A
week ago"
;
else
return
((
int
)
(
days
/
7
))
+
" weeks ago"
;
else
if
(
days
<
365
)
...
...
@@ -50,7 +48,7 @@ public class DateTimeUtil {
return
((
int
)
(
days
/
30
))
+
" months ago"
;
else
if
((
int
)
(
days
/
365
)
==
1
)
return
"
a
year ago"
;
return
"
A
year ago"
;
else
return
((
int
)
(
days
/
365
))
+
" years ago"
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment