Reputation: 5547
I tried the code below and it didn't work. I assume it's a little more involved.
@Html.Telerik().DatePickerFor(o => o.StartDt).Min(new System.DateTime.Now())
With Francois' suggestion, I get this error:
Upvotes: 0
Views: 1151
Reputation: 10968
Use Today()
instead of Now()
.
@Html.Telerik().DatePickerFor(o => o.StartDt).Min(System.DateTime.Today)
EDIT: of course, no need for NEW here :)
Upvotes: 1
Reputation: 9931
The correct way to get Today/Now is DateTime.Today
or DateTime.Now
. They aren't constructors, so new System.DateTime.Today()
will give you the error you're getting.
Use:
@Html.Telerik().DatePickerFor(o => o.StartDt).Min(System.DateTime.Today)
Also, a good answer on the difference between DateTime.Now
and DateTime.Today
: Difference between System.DateTime.Now and System.DateTime.Today
Upvotes: 1