Setting Mindate and MaxDate for Datepicker Control

前端 未结 3 932
小蘑菇
小蘑菇 2021-01-19 07:36

I\'m currently using DatePicker’s control, where I tried to limit the dates to show MinDate & Maxdate. Unfortunately I couldn\'t find any related method to set the Min a

3条回答
  •  误落风尘
    2021-01-19 08:03

    I assume you're developing on Windows 10 Universal Windows Platform. DatePicker in UWP, you can only set the MinYear and MaxYear. There's 4 datetime control that you can use (Refer to this link)

    I would suggest you to use the new Calendar Date Picker which allows you to set MinDate and MaxDate

    CalendarDatePicker cdp=new CalendarDatePicker();
    cdp.MinYear=DateTime.Now();
    cdp.MaxYear=DateTime.AddYears(3);
    

提交回复
热议问题