Skip to content

Commit

Permalink
Update compose docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kizitonwose committed Jul 27, 2024
1 parent f796741 commit a307277
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/Compose.md
Original file line number Diff line number Diff line change
Expand Up @@ -635,13 +635,13 @@ A year calendar implementation from the sample app:

The year calendar composables also provide a parameter `isMonthVisible` which determines if a month
is added to the calendar year grid. For example, if you want a calendar that starts in the year 2024
and ends in the year 2054, but only shows months from from July 2024, the logic would look like
and ends in the year 2054, but only shows months from October 2024, the logic would look like
this:

```kotlin
@Composable
fun MainScreen() {
val july2024 = remember { YearMonth.of(2024, Month.JULY) }
val october2024 = remember { YearMonth.of(2024, Month.OCTOBER) }
val startYear = remember { Year.of(2024) }
val endYear = remember { Year.of(2054) }
val firstDayOfWeek = remember { firstDayOfWeekFromLocale() }
Expand All @@ -657,8 +657,8 @@ fun MainScreen() {
dayContent = { Day(it) },
yearHeader = { YearHeader(it) },
monthHeader = { MonthHeader(it) },
isMonthVisible = { month ->
month.yearMonth >= july2024
isMonthVisible = { data ->
data.yearMonth >= october2024
}
)
}
Expand Down

0 comments on commit a307277

Please sign in to comment.