Default values for DateTime params

Aug 2, 2012 at 7:10 AM


I have an action that takes a DateTime parameter.

I have implemented a DefaultXXX method to provide a default value for the DateTime.

Wile it correctly populates the default value, it includes the time portion. Obviously for a DateTime parameter (that renders a date picker) I only want the date portion.

Im I missing something.

Aug 2, 2012 at 8:28 AM

You can add a Mask("d") attribute to an action parameter, in the same way that you can for a property.

Aug 2, 2012 at 9:01 AM

Obviously! Tnx. :)