Skip to content

Commit

Permalink
feat: [ANDROAPP-5794] remove old calendar from event details
Browse files Browse the repository at this point in the history
  • Loading branch information
xavimolloy committed Feb 21, 2024
1 parent 343d96f commit 13d1f18
Showing 1 changed file with 0 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.DatePicker
import androidx.activity.result.contract.ActivityResultContracts
import androidx.compose.foundation.layout.Column
import androidx.compose.runtime.Composable
Expand All @@ -27,8 +26,6 @@ import org.dhis2.commons.Constants.ORG_UNIT
import org.dhis2.commons.Constants.PROGRAM_STAGE_UID
import org.dhis2.commons.Constants.PROGRAM_UID
import org.dhis2.commons.data.EventCreationType
import org.dhis2.commons.dialogs.calendarpicker.CalendarPicker
import org.dhis2.commons.dialogs.calendarpicker.OnDatePickerListener
import org.dhis2.commons.locationprovider.LocationSettingLauncher
import org.dhis2.commons.orgunitselector.OUTreeFragment
import org.dhis2.commons.orgunitselector.OrgUnitSelectorScope
Expand Down Expand Up @@ -321,27 +318,6 @@ class EventDetailsFragment : FragmentGlobalAbstract() {
}
}

private fun showCalendarDialog() {
val dialog = CalendarPicker(requireContext())
dialog.setInitialDate(viewModel.eventDate.value.currentDate)
dialog.setMinDate(viewModel.eventDate.value.minDate)
dialog.setMaxDate(viewModel.eventDate.value.maxDate)
dialog.isFutureDatesAllowed(viewModel.eventDate.value.allowFutureDates)
dialog.setListener(
object : OnDatePickerListener {
override fun onNegativeClick() {}
override fun onPositiveClick(datePicker: DatePicker) {
viewModel.onDateSet(
datePicker.year,
datePicker.month,
datePicker.dayOfMonth,
)
}
},
)
dialog.show()
}

private fun showPeriodDialog() {
PeriodDialog()
.setPeriod(viewModel.eventDate.value.periodType)
Expand Down

0 comments on commit 13d1f18

Please sign in to comment.