fixing IllegalInstantException occurring in some cases

This commit is contained in:
tibbi 2018-09-21 14:42:33 +02:00
parent 994dd472c2
commit ebc26dc6e0
1 changed files with 1 additions and 1 deletions

View File

@ -66,7 +66,7 @@ object Formatter {
fun getDateTimeFromCode(dayCode: String) = DateTimeFormat.forPattern(DAYCODE_PATTERN).withZone(DateTimeZone.UTC).parseDateTime(dayCode) fun getDateTimeFromCode(dayCode: String) = DateTimeFormat.forPattern(DAYCODE_PATTERN).withZone(DateTimeZone.UTC).parseDateTime(dayCode)
fun getLocalDateTimeFromCode(dayCode: String) = DateTimeFormat.forPattern(DAYCODE_PATTERN).withZone(DateTimeZone.getDefault()).parseDateTime(dayCode) fun getLocalDateTimeFromCode(dayCode: String) = DateTimeFormat.forPattern(DAYCODE_PATTERN).withZone(DateTimeZone.getDefault()).parseLocalDate(dayCode).toDateTimeAtStartOfDay()
fun getTimeFromTS(context: Context, ts: Int) = getTime(context, getDateTimeFromTS(ts)) fun getTimeFromTS(context: Context, ts: Int) = getTime(context, getDateTimeFromTS(ts))