Is it possible to have DateTIme filtering in a custom column?

I have a custom column that only views date but not related to StartDate or EndDate. I want to apply DateTime filtering on it. The data is Javascript Date object. How can I enable DateTime filtering options for this specific column? Currently it is showing only Text filtering option. Thanks.

dateTime.png


3 Replies 1 reply marked as answer

SJ Sridharan Jayabalan Syncfusion Team December 4, 2024 10:54 AM UTC

Hi Manisha,


Greetings from Syncfusion.


To enable DateTime filtering for a custom column, you can use the format and type properties for the specific column. By setting the "type" property to 'datetime' and providing a date format using the format property, the column will support DateTime filtering. Refer code snippets and sample for your reference.

 

Code-Snippet:   

const Editing = () => {
  return (
        <GanttComponent>
          <ColumnsDirective>
            <ColumnDirective
              field="CustomDate"
              format={'MMM dd, y HH:mm'}
              type="datetime"
              width="250"
            ></ColumnDirective>
          </ColumnsDirective>
        </GanttComponent>
  );
};

 

Sample - Nbaf2q (forked) - StackBlitz


 

Regards,

Sridharan


Marked as answer

MG MANISHA GHOSH December 4, 2024 12:32 PM UTC

Hello Sridharan,

That's exactly what I was looking for. Thanks a lot!




KG Kalpana Ganesan Syncfusion Team December 5, 2024 05:09 AM UTC

Hi Manisha,


You're welcome, please get back to us for further assistance.


Regards,

Kalpana.


Loader.
Up arrow icon