fix #13, use proper short day versions, dont always substring to 3 chars

This commit is contained in:
tibbi 2018-03-28 19:07:13 +02:00
parent f3c018f6b4
commit 22454df944
2 changed files with 3 additions and 4 deletions

View file

@ -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'

View file

@ -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<Int, String> {