You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-10Lines changed: 9 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -20,24 +20,16 @@ Library is available on Maven Central repository.
20
20
```
21
21
Snapshots are available on [Sonatype’s snapshots repository](https://s01.oss.sonatype.org/content/repositories/snapshots/io/github/boguszpawlowski/composecalendar/).
@@ -144,6 +136,10 @@ Apart from rendering your own components inside the calendar, you can modify it
144
136
-`showAdjacentMonths` - whenever to render days from adjacent months. Defaults to `true`.
145
137
-`firstDayOfWeek` - you can pass the `DayOfWeek` which you want you week to start with. It defaults to the first day of week of the `Locale.default()`.
146
138
-`horizontalScrollEnabled` - a Boolean flag which enables month to be changed by a horizontal swipe. Defaults to `true`.
139
+
-`minMonth` - a `YearMonth` object representing the minimum month that can be shown in the calendar. By default there is no minimum month.
140
+
-`maxMonth` - a `YearMonth` object representing the maximum month that can be shown in the calendar. By default there is no maximum month.
141
+
142
+
> :exclamation: You cannot set `minMonth` to be lower than `maxMonth` and vice versa. If you do so, the calendar state won't change.
147
143
148
144
Apart from this, `Calendar` you can pass a `Modifier` object like in any other composable.
149
145
@@ -213,6 +209,9 @@ Selection modes are represented by `SelectionMode` enum, with following values:
213
209
-`Period` - selectable period - implemented by `start` and `end` dates. - selection will contain all dates between start and the end date.
214
210
This implementation of SelectionState also allows for handling side-effects and vetoing the state change via `confirmSelectionChange` callback.
215
211
212
+
## Week Calendar
213
+
Apart from the default calendar, there is also a week calendar, which shows a single week at a time. It can be used in the same way as the default calendar, and has the same customization options.
214
+
216
215
## KotlinX DateTime
217
216
As the core of the library is built on `java.time` library, on Android it requires to use [core libary desugaring](https://developer.android.com/studio/write/java8-support) to be able to access it's API.
218
217
As a result it's features may be unavailable to some project built around different date-time libraries (e.g. kotlinx-datetime). Although the project wont be migrating from `java.time`, as it's the best suited for it, there is a separate `kotlinx-datetime` artifact for those who need to use the library from a codebase based on it. It doesn't consist of a separate version of `ComposeCalendar` features, but offers a small bunch of utilities, that will enable you to create your own wrapper, as briefly presented in `KotlinDateTimeSample`. If the provided functionality, doesn't match your use-case, please submit an issue.
Copy file name to clipboardExpand all lines: library/api/library.api
+13-3Lines changed: 13 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -76,8 +76,8 @@ public final class io/github/boguszpawlowski/composecalendar/WeekCalendarKt {
76
76
public static final fun SelectableWeekCalendar (Landroidx/compose/ui/Modifier;Ljava/time/DayOfWeek;Ljava/time/LocalDate;ZZLio/github/boguszpawlowski/composecalendar/WeekCalendarState;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Landroidx/compose/runtime/Composer;II)V
77
77
public static final fun StaticWeekCalendar (Landroidx/compose/ui/Modifier;Ljava/time/DayOfWeek;Ljava/time/LocalDate;ZLio/github/boguszpawlowski/composecalendar/WeekCalendarState;ZLkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Landroidx/compose/runtime/Composer;II)V
78
78
public static final fun WeekCalendar (Lio/github/boguszpawlowski/composecalendar/WeekCalendarState;Landroidx/compose/ui/Modifier;Ljava/time/LocalDate;Ljava/time/DayOfWeek;ZZLkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Landroidx/compose/runtime/Composer;II)V
79
-
public static final fun rememberSelectableWeekCalendarState (Ljava/time/DayOfWeek;Lio/github/boguszpawlowski/composecalendar/week/Week;Ljava/util/List;Lio/github/boguszpawlowski/composecalendar/selection/SelectionMode;Lkotlin/jvm/functions/Function1;Lio/github/boguszpawlowski/composecalendar/header/WeekState;Lio/github/boguszpawlowski/composecalendar/selection/DynamicSelectionState;Landroidx/compose/runtime/Composer;II)Lio/github/boguszpawlowski/composecalendar/WeekCalendarState;
80
-
public static final fun rememberWeekCalendarState (Ljava/time/DayOfWeek;Lio/github/boguszpawlowski/composecalendar/week/Week;Lio/github/boguszpawlowski/composecalendar/header/WeekState;Landroidx/compose/runtime/Composer;II)Lio/github/boguszpawlowski/composecalendar/WeekCalendarState;
79
+
public static final fun rememberSelectableWeekCalendarState (Ljava/time/DayOfWeek;Lio/github/boguszpawlowski/composecalendar/week/Week;Lio/github/boguszpawlowski/composecalendar/week/Week;Lio/github/boguszpawlowski/composecalendar/week/Week;Ljava/util/List;Lio/github/boguszpawlowski/composecalendar/selection/SelectionMode;Lkotlin/jvm/functions/Function1;Lio/github/boguszpawlowski/composecalendar/header/WeekState;Lio/github/boguszpawlowski/composecalendar/selection/DynamicSelectionState;Landroidx/compose/runtime/Composer;II)Lio/github/boguszpawlowski/composecalendar/WeekCalendarState;
80
+
public static final fun rememberWeekCalendarState (Ljava/time/DayOfWeek;Lio/github/boguszpawlowski/composecalendar/week/Week;Lio/github/boguszpawlowski/composecalendar/week/Week;Lio/github/boguszpawlowski/composecalendar/week/Week;Lio/github/boguszpawlowski/composecalendar/header/WeekState;Landroidx/compose/runtime/Composer;II)Lio/github/boguszpawlowski/composecalendar/WeekCalendarState;
81
81
}
82
82
83
83
public final class io/github/boguszpawlowski/composecalendar/WeekCalendarState {
@@ -159,15 +159,19 @@ public final class io/github/boguszpawlowski/composecalendar/header/MonthStateKt
159
159
public abstract interface class io/github/boguszpawlowski/composecalendar/header/WeekState {
160
160
public static final field Companion Lio/github/boguszpawlowski/composecalendar/header/WeekState$Companion;
161
161
public abstract fun getCurrentWeek ()Lio/github/boguszpawlowski/composecalendar/week/Week;
162
+
public abstract fun getMaxWeek ()Lio/github/boguszpawlowski/composecalendar/week/Week;
163
+
public abstract fun getMinWeek ()Lio/github/boguszpawlowski/composecalendar/week/Week;
162
164
public abstract fun setCurrentWeek (Lio/github/boguszpawlowski/composecalendar/week/Week;)V
165
+
public abstract fun setMaxWeek (Lio/github/boguszpawlowski/composecalendar/week/Week;)V
166
+
public abstract fun setMinWeek (Lio/github/boguszpawlowski/composecalendar/week/Week;)V
163
167
}
164
168
165
169
public final class io/github/boguszpawlowski/composecalendar/header/WeekState$Companion {
166
170
public final fun Saver ()Landroidx/compose/runtime/saveable/Saver;
167
171
}
168
172
169
173
public final class io/github/boguszpawlowski/composecalendar/header/WeekStateKt {
170
-
public static final fun WeekState (Lio/github/boguszpawlowski/composecalendar/week/Week;)Lio/github/boguszpawlowski/composecalendar/header/WeekState;
174
+
public static final fun WeekState (Lio/github/boguszpawlowski/composecalendar/week/Week;Lio/github/boguszpawlowski/composecalendar/week/Week;Lio/github/boguszpawlowski/composecalendar/week/Week;)Lio/github/boguszpawlowski/composecalendar/header/WeekState;
171
175
}
172
176
173
177
public final class io/github/boguszpawlowski/composecalendar/selection/DynamicSelectionHandler {
@@ -223,6 +227,7 @@ public final class io/github/boguszpawlowski/composecalendar/week/Week {
223
227
public static final field $stable I
224
228
public static final field Companion Lio/github/boguszpawlowski/composecalendar/week/Week$Companion;
225
229
public fun <init> (Ljava/util/List;)V
230
+
public final fun compareTo (Lio/github/boguszpawlowski/composecalendar/week/Week;)I
226
231
public final fun component1 ()Ljava/util/List;
227
232
public final fun copy (Ljava/util/List;)Lio/github/boguszpawlowski/composecalendar/week/Week;
228
233
public static synthetic fun copy$default (Lio/github/boguszpawlowski/composecalendar/week/Week;Ljava/util/List;ILjava/lang/Object;)Lio/github/boguszpawlowski/composecalendar/week/Week;
@@ -234,6 +239,7 @@ public final class io/github/boguszpawlowski/composecalendar/week/Week {
234
239
public final fun getYearMonth ()Ljava/time/YearMonth;
235
240
public fun hashCode ()I
236
241
public final fun inc ()Lio/github/boguszpawlowski/composecalendar/week/Week;
242
+
public final fun minusWeeks (J)Lio/github/boguszpawlowski/composecalendar/week/Week;
237
243
public final fun plusWeeks (J)Lio/github/boguszpawlowski/composecalendar/week/Week;
238
244
public fun toString ()Ljava/lang/String;
239
245
}
@@ -243,3 +249,7 @@ public final class io/github/boguszpawlowski/composecalendar/week/Week$Companion
243
249
public static synthetic fun now$default (Lio/github/boguszpawlowski/composecalendar/week/Week$Companion;Ljava/time/DayOfWeek;ILjava/lang/Object;)Lio/github/boguszpawlowski/composecalendar/week/Week;
244
250
}
245
251
252
+
public final class io/github/boguszpawlowski/composecalendar/week/WeekKt {
253
+
public static final fun between (Ljava/time/temporal/ChronoUnit;Lio/github/boguszpawlowski/composecalendar/week/Week;Lio/github/boguszpawlowski/composecalendar/week/Week;)I
0 commit comments