Skip to content

Redman1037/EightFoldsDatePickerDialog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

EightFoldsDatePickerDialog

Using this you can easily set minimum and maximum dates to a datepicker dialog

Usage

Copy EightFoldsDatePickerDialog.java to your project

 
        val calendar = Calendar.getInstance()
        val datePickerDialog = EightFoldsDatePickerDialog(
            this,
            object : DatePickerDialog.OnDateSetListener {
                override fun onDateSet(view: DatePicker, year: Int, month: Int, dayOfMonth: Int) {

                    val date = "$dayOfMonth/$month/$year"
                   
                }
            },
            calendar.get(Calendar.YEAR),
            calendar.get(Calendar.MONTH),
            calendar.get(Calendar.DATE)
        )  

        datePickerDialog.setMinDate(2017,8,7); //arguments are   year , month , date (use for setting custom mix date)
        datePickerDialog.setMaxDate(2017,8,25);  //arguments are   year , month , date (use for setting custom max date)
       
     //   datePickerDialog.setTodayAsMinDate();   // sets today's date as min date
     //   datePickerDialog.setTodayAsMaxDate();    // sets today's date as max date

        datePickerDialog.show()

Result

About

DatePickerDialog to set min and max dates

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages