properly handle week days string creation if sunday is the first day
This commit is contained in:
parent
2bfc40c83d
commit
08fd5e155c
1 changed files with 9 additions and 1 deletions
|
@ -357,8 +357,16 @@ fun Context.isPackageInstalled(pkgName: String): Boolean {
|
|||
// format day bits to strings like "Mon, Tue, Wed"
|
||||
fun Context.getSelectedDaysString(bitMask: Int): String {
|
||||
val dayBits = arrayListOf(MONDAY_BIT, TUESDAY_BIT, WEDNESDAY_BIT, THURSDAY_BIT, FRIDAY_BIT, SATURDAY_BIT, SUNDAY_BIT)
|
||||
val weekDays = resources.getStringArray(R.array.week_days).toList() as ArrayList<String>
|
||||
|
||||
if (baseConfig.isSundayFirst) {
|
||||
val sundayBit = dayBits.removeAt(dayBits.size - 1)
|
||||
dayBits.add(0, sundayBit)
|
||||
|
||||
val sunday = weekDays.removeAt(weekDays.size - 1)
|
||||
weekDays.add(0, sunday)
|
||||
}
|
||||
|
||||
val weekDays = resources.getStringArray(R.array.week_days)
|
||||
var days = ""
|
||||
dayBits.forEachIndexed { index, bit ->
|
||||
if (bitMask and bit != 0) {
|
||||
|
|
Loading…
Reference in a new issue