This project has moved and is read-only. For the latest updates, please go here.

DatePicker MinDate and MaxDate request


I would like to set a min and max date on the DatePicker control.


dbachrach wrote Jul 8, 2011 at 5:17 PM

Anyone who is interested in this feature, can you explain your use case? Are you using this feature for Todo lists, reminders, agendas, or anything else? What's are the typical constraints? Setting either min or max, or setting both? What are the typical size of ranges you expect between min and max?


jeremypippen2007 wrote Jul 8, 2011 at 6:10 PM

This was for a time entry system at work. We enter our time in week by week. The functionality on our website displays only one week at a time, and when you enter time, our date picker only shows the current week. We wanted to keep it the same if possible on our WP7 app.

wrote Aug 16, 2011 at 5:43 AM

wrote Nov 21, 2011 at 5:03 AM

wrote Apr 5, 2012 at 2:40 AM

wrote May 16, 2012 at 2:35 PM

klange wrote Jul 6, 2012 at 4:41 PM

I am interested in this feature. My most common use case is that the user must enter a Date Of Birth for a record keeping system. I want to limit the data entry to a value that is possible for a living person. (Say 1/1/1850 - Now).

Also, I am usually storing the entered date in an SQL database where the datetime has a different range than the .Net DateTime. Currently, the date picker allows the user to enter a date such as 1/1/1111 that doesn't fit in SQL so I get an ugly exception down at the database layer.

So, currently, my solution is to use "Validation". But it would be cleaner to me if the user couldn't enter bad dates in the first place.

(For other people struggling with this issue, check out System.ComponentModel.DataAnnotations.RangeAttribute)

[Range(typeof(DateTime), "1/1/1900", "12/31/2099", ErrorMessage = "Value for {0} must be between {1} and {2}")]


Bevan wrote Aug 10, 2012 at 5:19 AM

I think this would be a great addition to the control.

you asked for an example so in my case I have an app that is tracking task data.
One of the fields is the date the task was actually completed. Obviously it should not be possible to set any date in the future as this could only be a guess at best and not an actual date of completion.
In my case I would like to be able to set a MaxDate property (in my current scenario this would be It would also be useful to be able to provide a string that could be displayed in the control explaining the date constraint rule to the user to avoid frustration.

wrote Aug 10, 2012 at 5:19 AM

wrote Feb 22, 2013 at 2:50 AM

wrote Apr 8, 2013 at 4:03 AM

wrote Oct 23, 2013 at 12:11 AM