Default values for DateTime params

Aug 2, 2012 at 6:10 AM

Hi.

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.

Coordinator
Aug 2, 2012 at 7: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 8:01 AM

Obviously! Tnx. :)