Skip to content

Commit

Permalink
fix september month error
Browse files Browse the repository at this point in the history
short for september is SEPT in Locale, but I was converting it to sep for index extraction hence the issue

[Ticket: X]
  • Loading branch information
Dark-Knight11 committed Sep 1, 2024
1 parent 1366b56 commit 0253e75
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,11 @@ import com.finflio.ui.theme.GoldIcon
import com.finflio.ui.theme.OrangeRed
import com.finflio.ui.theme.TransactionCardBg
import com.finflio.ui.theme.screenSize
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import java.text.DateFormatSymbols
import java.time.LocalDate
import java.time.Year
import java.util.Locale
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch

@Composable
fun MonthDropDown(
Expand Down Expand Up @@ -211,9 +210,14 @@ fun MonthPicker(
val months = DateFormatSymbols.getInstance(Locale.getDefault()).shortMonths.toList()
var displayMonth = month
var displayYear = year
var slice = if (month == "September") {
month.slice(0..3)
} else {
month.slice(0..2)
}

var selectedMonth by remember {
mutableStateOf(months[months.indexOf(month.slice(0..2))])
mutableStateOf(months[months.indexOf(slice)])
}
var selectedYear by remember {
mutableIntStateOf(year)
Expand Down

0 comments on commit 0253e75

Please sign in to comment.