refactored getFormattedDate

This commit is contained in:
Chumva 2018-08-17 14:03:38 +03:00
parent fe633f06a2
commit f14b96fb88

View file

@ -73,10 +73,9 @@ object OsmandFormatter {
} }
} }
fun getFormattedDate(seconds: Long): String { fun getFormattedDate(seconds: Long): String =
val day = SimpleDateFormat(SIMPLE_DATE_FORMAT, Locale.getDefault()) SimpleDateFormat(SIMPLE_DATE_FORMAT, Locale.getDefault()).format(seconds * 1000L)
return day.format(Date(seconds * 1000L))
}
fun calculateRoundedDist(distInMeters: Double, ctx: TelegramApplication): Double { fun calculateRoundedDist(distInMeters: Double, ctx: TelegramApplication): Double {
val mc = ctx.settings.metricsConstants val mc = ctx.settings.metricsConstants