improve time parsing for text locations
This commit is contained in:
parent
a2bc710c00
commit
9c25f2dd8f
1 changed files with 2 additions and 2 deletions
|
@ -761,8 +761,8 @@ class TelegramHelper private constructor() {
|
|||
val locStr = s.removePrefix(LOCATION_PREFIX)
|
||||
try {
|
||||
val (latS, lonS) = locStr.split(" ")
|
||||
val updatedS = locStr.substring(locStr.indexOf("(") + 1, locStr.indexOf(")"))
|
||||
val timeSecs = parseTime(updatedS)
|
||||
val updatedS = locStr.substring(locStr.indexOf("("), locStr.length)
|
||||
val timeSecs = parseTime(updatedS.removePrefix("(").removeSuffix(")"))
|
||||
res.lat = latS.dropLast(1).toDouble()
|
||||
res.lon = lonS.toDouble()
|
||||
res.editDate = (System.currentTimeMillis() / 1000 - timeSecs).toInt()
|
||||
|
|
Loading…
Reference in a new issue