From 22454df9443d75871c0812c0e5d51715fbdb5955 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 28 Mar 2018 19:07:13 +0200 Subject: [PATCH] fix #13, use proper short day versions, dont always substring to 3 chars --- app/build.gradle | 2 +- .../kotlin/com/simplemobiletools/clock/extensions/Context.kt | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index b67031a9..037b1338 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -41,7 +41,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:3.17.6' + implementation 'com.simplemobiletools:commons:3.17.8' implementation 'com.facebook.stetho:stetho:1.5.0' implementation 'com.android.support.constraint:constraint-layout:1.0.2' implementation 'com.shawnlin:number-picker:2.4.6' diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/clock/extensions/Context.kt index fa325b60..1f731281 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/extensions/Context.kt @@ -46,10 +46,9 @@ fun Context.getFormattedDate(calendar: Calendar): String { val dayOfMonth = calendar.get(Calendar.DAY_OF_MONTH) val month = calendar.get(Calendar.MONTH) - val dayString = resources.getStringArray(R.array.week_days)[dayOfWeek] - val shortDayString = dayString.substring(0, Math.min(3, dayString.length)) + val dayString = resources.getStringArray(R.array.week_days_short)[dayOfWeek] val monthString = resources.getStringArray(R.array.months)[month] - return "$shortDayString, $dayOfMonth $monthString" + return "$dayString, $dayOfMonth $monthString" } fun Context.getEditedTimeZonesMap(): HashMap {