Skip to content

Commit

Permalink
January to January issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
BerkkanB committed Jan 31, 2022
1 parent 7bf6738 commit 409b2bd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions app/src/main/java/com/dt/calendarwork/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ class MainActivity : ComponentActivity() {
@Composable
fun MainScreen() {
val calendar = Calendar.getInstance()
calendar.set(Calendar.YEAR, 2022)
calendar.set(Calendar.MONTH, 1)
calendar.set(Calendar.YEAR, 2021)
calendar.set(Calendar.MONTH, 5)
calendar.set(Calendar.DAY_OF_MONTH, 1)

val calendarMax = Calendar.getInstance()
calendarMax.set(Calendar.YEAR, 2032)
calendarMax.set(Calendar.MONTH, 9)
calendarMax.set(Calendar.YEAR, 2022)
calendarMax.set(Calendar.MONTH, 0)
calendar.set(Calendar.DAY_OF_MONTH, 1)

val (open, setOpen) = remember {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ fun MonthItem(
}
}
private fun checkDate(minYear: Int,maxYear: Int,selectedYear: Int,minMonth: Int,maxMonth: Int,numberOfElement: Int):Boolean{
if(minMonth==0) return true

if (minYear == maxYear) return numberOfElement in minMonth..maxMonth
if (selectedYear==minYear){
return numberOfElement>=minMonth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ private fun checkDate(
maxMonth: Int,
numberOfElement: Int,
): Boolean {
if (minMonth == 0) return true

if (minYear == maxYear) return numberOfElement in minMonth..maxMonth
if (selectedYear == minYear) {
return numberOfElement >= minMonth
Expand Down

0 comments on commit 409b2bd

Please sign in to comment.