Skip to content

Commit

Permalink
fix:#1216 Min date picker fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
haran2248 committed Feb 23, 2021
1 parent 2e6ae77 commit 47907ad
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package org.mifos.mobilewallet.mifospay.standinginstruction.ui

import android.annotation.SuppressLint
import android.app.DatePickerDialog
import android.content.res.Resources
import android.os.Build
import android.os.Bundle
import android.support.annotation.RequiresApi
import android.view.Menu
import android.view.MenuItem
import android.view.View
Expand All @@ -19,6 +22,9 @@ import org.mifos.mobilewallet.mifospay.standinginstruction.presenter.StandingIns
import org.mifos.mobilewallet.mifospay.utils.Constants
import org.mifos.mobilewallet.mifospay.utils.DialogBox
import org.mifos.mobilewallet.mifospay.utils.Utils
import java.text.SimpleDateFormat
import java.time.LocalDate
import java.time.format.DateTimeFormatter
import java.util.*
import javax.inject.Inject

Expand All @@ -41,6 +47,7 @@ class SIDetailsActivity : BaseActivity(), StandingInstructionContract.SIDetailsV
private lateinit var mStandingInstructionPresenter:
StandingInstructionContract.StandingInstructorDetailsPresenter

@SuppressLint("NewApi")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_si_details)
Expand Down Expand Up @@ -68,6 +75,7 @@ class SIDetailsActivity : BaseActivity(), StandingInstructionContract.SIDetailsV
DatePickerDialog.OnDateSetListener { view, year, monthOfYear, dayOfMonth ->
tv_valid_till.text = "$dayOfMonth-${(monthOfYear + 1)}-$year"
}, year, month, day)
picker.datePicker.minDate = SimpleDateFormat("dd-MM-yyyy").parse(tv_valid_from.text.toString()).time
picker.show()
}

Expand Down

0 comments on commit 47907ad

Please sign in to comment.