Fixed conference scheduler date picker showing wrong date for UTC-X timezones
This commit is contained in:
parent
66edc747be
commit
8b86f91c1f
1 changed files with 5 additions and 1 deletions
|
@ -64,7 +64,11 @@ class TimestampUtils {
|
||||||
|
|
||||||
val calendar = Calendar.getInstance()
|
val calendar = Calendar.getInstance()
|
||||||
calendar.timeInMillis = if (timestampInSecs) date * 1000 else date
|
calendar.timeInMillis = if (timestampInSecs) date * 1000 else date
|
||||||
return SimpleDateFormat(pattern, Locale.getDefault()).format(calendar.time)
|
|
||||||
|
// See https://github.com/material-components/material-components-android/issues/882
|
||||||
|
val dateFormatter = SimpleDateFormat(pattern, Locale.getDefault())
|
||||||
|
dateFormatter.timeZone = TimeZone.getTimeZone("UTC")
|
||||||
|
return dateFormatter.format(calendar.time)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun timeToString(hour: Int, minutes: Int): String {
|
fun timeToString(hour: Int, minutes: Int): String {
|
||||||
|
|
Loading…
Reference in a new issue