更新部分UI
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.aiosman.riderpro.data.api
|
||||
|
||||
import android.icu.text.SimpleDateFormat
|
||||
import android.icu.util.TimeZone
|
||||
import com.aiosman.riderpro.AppStore
|
||||
import com.aiosman.riderpro.ConstVars
|
||||
import okhttp3.Interceptor
|
||||
@@ -85,9 +86,13 @@ object ApiClient {
|
||||
}
|
||||
|
||||
fun dateFromApiString(apiString: String): Date {
|
||||
val timeFormat = ApiClient.TIME_FORMAT
|
||||
val timeFormat = TIME_FORMAT
|
||||
val simpleDateFormat = SimpleDateFormat(timeFormat, Locale.getDefault())
|
||||
simpleDateFormat.timeZone = TimeZone.getTimeZone("UTC")
|
||||
val date = simpleDateFormat.parse(apiString)
|
||||
return date
|
||||
|
||||
simpleDateFormat.timeZone = TimeZone.getDefault()
|
||||
val localDateString = simpleDateFormat.format(date)
|
||||
return simpleDateFormat.parse(localDateString)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user