I’ve found that the Date.TryParse is pretty lenient on input – so skipping out the day or month will still return a value, though always floor rounded. E.g.:
DateTime.TryParse("2010", out testDate)
-> 01 Jan 2010
or
DateTime.TryParse("may 2010", out testDate)
-> 01 May 2010
I’d like to allow the user to input a date to be used as the upper date limit for a search – Is there a simple way to get it to round up – e.g.: return 31/12/2010 when just ‘2010’ is entered…
Thanks in advance.
You could have something like this: