Replaced log calls from magiskdb to repo

This commit is contained in:
Viktor De Pasquale
2019-05-09 17:01:34 +02:00
parent 90d85eaf7d
commit 7abdac72a4
7 changed files with 55 additions and 50 deletions
@@ -1,13 +1,14 @@
package com.topjohnwu.magisk.utils
import java.text.DateFormat
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.*
val now get() = System.currentTimeMillis()
fun Long.toTime(format: SimpleDateFormat) = format.format(this).orEmpty()
fun String.toTime(format: SimpleDateFormat) = try {
fun Long.toTime(format: DateFormat) = format.format(this).orEmpty()
fun String.toTime(format: DateFormat) = try {
format.parse(this)?.time ?: -1
} catch (e: ParseException) {
-1L
@@ -15,4 +16,6 @@ fun String.toTime(format: SimpleDateFormat) = try {
private val locale get() = Locale.getDefault()
val timeFormatFull by lazy { SimpleDateFormat("yyyy/MM/dd_HH:mm:ss", locale) }
val timeFormatStandard by lazy { SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", locale) }
val timeFormatStandard by lazy { SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", locale) }
val timeFormatMedium by lazy { DateFormat.getDateInstance(DateFormat.MEDIUM, LocaleManager.locale) }
val timeFormatTime by lazy { SimpleDateFormat("h:mm a", LocaleManager.locale) }