Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
e
os
GmsCore
Commits
8dceaad8
Unverified
Commit
8dceaad8
authored
Apr 17, 2021
by
Fynn Godau
Committed by
GitHub
Apr 17, 2021
Browse files
Fix date format being used incorrectly (#1443)
fixes #1441
parent
a173d268
Changes
1
Hide whitespace changes
Inline
Side-by-side
play-services-nearby-core-ui/src/main/kotlin/org/microg/gms/nearby/core/ui/DotChartView.kt
View file @
8dceaad8
...
...
@@ -10,14 +10,12 @@ import android.annotation.TargetApi
import
android.content.Context
import
android.graphics.*
import
android.os.Build
import
android.provider.Settings
import
android.text.TextUtils
import
android.text.format.DateFormat
import
android.util.AttributeSet
import
android.view.MotionEvent
import
android.view.View
import
org.microg.gms.nearby.exposurenotification.ExposureScanSummary
import
org.microg.gms.ui.resolveColor
import
java.text.SimpleDateFormat
import
java.util.*
import
kotlin.math.max
import
kotlin.math.min
...
...
@@ -38,12 +36,7 @@ class DotChartView : View {
val
now
=
System
.
currentTimeMillis
()
val
min
=
now
-
14
*
24
*
60
*
60
*
1000L
val
date
=
Date
(
min
)
val
format
=
Settings
.
System
.
getString
(
context
.
contentResolver
,
Settings
.
System
.
DATE_FORMAT
);
val
dateFormat
=
if
(
TextUtils
.
isEmpty
(
format
))
{
android
.
text
.
format
.
DateFormat
.
getMediumDateFormat
(
context
)
}
else
{
SimpleDateFormat
(
format
)
}
val
dateFormat
=
DateFormat
.
getMediumDateFormat
(
context
)
val
lowest
=
dateFormat
.
parse
(
dateFormat
.
format
(
date
))
?.
time
?:
date
.
time
for
(
day
in
0
until
15
)
{
date
.
time
=
now
-
(
14
-
day
)
*
24
*
60
*
60
*
1000L
...
...
Write
Preview
Supports
Markdown
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