Suoranta.EnterpriseLib.Web - Developer API

JsonDateParserFilter Class

This filter may be required for actions that receive dates or datetimes from an HTML form under either of the following conditions:
  • The field is not backed by a widget that can return a JavaScript Date object.
  • The JS Date object is serialized to format other than ISO 8601.
  • The Controller does not support parsing ISO 8601 and it is undesirable to change deserializer that it is using.

Namespace:  Suoranta.EnterpriseLib.Web.MVC.Filters
Assembly:  Suoranta.EnterpriseLib.Web (in Suoranta.EnterpriseLib.Web.dll)

Syntax


public class JsonDateParserFilter : ReadJsonFilter

Remarks


If the JS Date object is available, it should be converted to a string using JS Date.toISOString method. JQuery $.ajax() does not serialize Date objects in proper format (calls .toString()) and JSON.stringify causes other issues.

Inheritance Hierarchy


Object
  Attribute
    FilterAttribute
      ActionFilterAttribute
        Suoranta.EnterpriseLib.Web.MVC.Filters..::..ReadJsonFilter
          Suoranta.EnterpriseLib.Web.MVC.Filters..::..JsonDateParserFilter