Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
Custom String Date Filter


I am having issues with date filters. The problem is that since there is no date type in JSON all the data comes from server with string representations of dates. Since the dataType date only supports actual date objects this doesn't work. So unless we pre-enrich all our data to convert to actual date objects we don't get date filtering. Rather than pre-enrich data I was trying to write a custom date filter which would convert the date strings to dates. The trouble for that is that if I have the column data type as string then it gives string text filter options. I have to use dataType of date for it to properly support picking dates. However, if I use the dataType of date then it tries to call toDateString() method on the values which obviously isn't supported and so throws error. I am using excel style filtering. Is there anyway to have the data stay as a string but get the date filter to support date operations?


  • 480
    Offline posted

    Hello Katy,

    Thank you for contacting Infragistics Community!

    After investigating this matter further and doing some research, the dataType=”’date’” currently does not support data of type string and has been determined to be a feature request. You can submit feature request in our GitHub repository here.

    Remember when submitting your idea to explain the context in which a feature would be used and why it is needed as well as anything that would prevent you from accomplishing this today. You can even add screenshots to build a stronger case.

    This will give you the opportunity do directly communicate with our development team regarding the issue and get notifications whenever a new information is available.

    Meanwhile I would suggest the following two approaches, which has to be implemented on application level and which are beyond the scope of Infragistics Support:

    • As you mentioned I suggest pre-enriching the data and creating actual date objects. Please keep in mind that in case the user is allowed to edit the grid, before storing the data on the server it has to be backwards converted to string.
    • If you want to stick to using custom filtering strategy I would suggest taking a look at the Template Section of the Excel Style Filtering Topic in our official documentation. As stated there, the Excel Style Filtering component can be fully templated, meaning that only for the desired column you can create your own UI which will control the filtering using the igxGrid’s filtering API. (you can refer to the Usage Section of the Filtering Topic in our official documentation)

    Please let me know if you need any further information.

    Best Regards,
    Martin Evtimov
    Entry Level Software Developer
    Infragistics, Inc.


Reply Children
No Data