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
60
How to filter a DateTime filtering column in iggrid without providing time
posted

Hi Team,

      According to the current functionality, when i filter a DateTime column in the igGrid by giving only date value the current time is automatically taken and the filtering is done.  

I would like to know if there is any option available to filter the DateTime column by providing only date value and getting the respective record filtered without changing the datatype of the column to Date.

Thanks in advance

Parents
  • 485
    Offline posted

    Hello Ramesh,

     

    Thank you for posting in our forum.

     

    The column dataTypes supported by the igGrid are string, number, date, object and boolean only. I guess what you mean by “dateTime” column type is actually a “dateTime” format for the date column? Please note that these formats get applied by the formatter function when the grid is rendering, but the underlying Date objects still contain the hours and minutes.

    When no hours and minutes have been set in the Filtering datePicker, the created date defaults to 12:00 AM for the date selected by the user, not to the current date and time (unless I am missing something that you have in your grid configuration?).

    I would appreciate you providing more details on what the expected Filtering behavior is and why do you need to remove the hours and minutes – is there some specific requirement that you have?

    As a side note, trying to remove the hours and minutes from the Date objects might lead to precision problems when comparing dates from different time zones. This Stackoverflow thread gives more detailed explanation:

     

    https://stackoverflow.com/questions/2698725/comparing-date-part-only-without-comparing-time-in-javascript

     

    If you need any additional assistance, feel free to contact me.

Reply Children