ClearableDatePickerSample icon indicating copy to clipboard operation
ClearableDatePickerSample copied to clipboard

How to set Maximum and Minimum dates?

Open SatyaRamprasad opened this issue 6 years ago • 1 comments

SatyaRamprasad avatar Mar 21 '18 09:03 SatyaRamprasad

Add this to the method below

private void ShowDatePicker() { CreateDatePickerDialog(this.Element.Date.Year, this.Element.Date.Month - 1, this.Element.Date.Day);

        Calendar cal = new GregorianCalendar();
        cal.Set(Element.MaximumDate.Year, Element.MaximumDate.Month, Element.MaximumDate.Day);

        Date dateRepresentation = cal.Time;

        _dialog.DatePicker.MaxDate = dateRepresentation.Time;

        _dialog.Show();
    }

I.e only important is the _dialog.DatePicker.MaxDate BUT it won't work unless the date is in java date time

Do same for DatePicker.MinDate and it will work

oscarjaergren avatar Jun 15 '19 15:06 oscarjaergren