Skip to content
Snippets Groups Projects
Unverified Commit 2ba3ec0f authored by Alex Paulescu's avatar Alex Paulescu Committed by GitHub
Browse files

Update UTC time to LocalTime (#1041) (EXPOSUREAPP-1863)

parent 6e8b0535
No related branches found
No related tags found
No related merge requests found
......@@ -119,10 +119,10 @@ object RetrieveDiagnosisKeysTransaction : Transaction() {
private val exportFilesForRollback = AtomicReference<List<File>>()
suspend fun startWithConstraints() {
val currentDate = DateTime(Instant.now(), DateTimeZone.UTC)
val currentDate = DateTime(Instant.now(), DateTimeZone.getDefault())
val lastFetch = DateTime(
LocalData.lastTimeDiagnosisKeysFromServerFetch(),
DateTimeZone.UTC
DateTimeZone.getDefault()
)
if (LocalData.lastTimeDiagnosisKeysFromServerFetch() == null ||
currentDate.withTimeAtStartOfDay() != lastFetch.withTimeAtStartOfDay()
......
......@@ -64,10 +64,10 @@ class TracingViewModel : ViewModel() {
try {
// get the current date and the date the diagnosis keys were fetched the last time
val currentDate = DateTime(Instant.now(), DateTimeZone.UTC)
val currentDate = DateTime(Instant.now(), DateTimeZone.getDefault())
val lastFetch = DateTime(
LocalData.lastTimeDiagnosisKeysFromServerFetch(),
DateTimeZone.UTC
DateTimeZone.getDefault()
)
// check if the keys were not already retrieved today
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment