Filter One Field by a Different Field

I've got a CreatedDate column and a CreatedDateString column. The CreatedDateString column is a formatted version of CreatedDate (I'm doing this b/c the built-in formatter is attempting to do a time zone adjustment that I don't want and the suggested workarounds aren't working for me). 

I need to be able to filter the CreatedDateString column, but it is not a date (I set the type to "date", but that just makes the date picker filter appear) and filtering yields no results.

How can I achieve this? 

3 Replies

SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team November 17, 2017 06:35 AM UTC

Hi Matt,  
 
Thanks for contacting Syncfusion Support.  
 
We could see you are facing server timezone offset difference. So, you have chosen to render a duplicate column for the date column. We can overcome this server timezone offset difference using the ej.serverTimezoneOffset an helper function. This has been discussed in the following Help Document. Please refer to it.  
 
 
Regards,  
Seeni Sakthi Kumar S. 



MA Matt Abercrombie January 16, 2018 07:03 PM UTC

I'm using the suggested timezone offset as stated in the help document. My server is UTC and most of my clients are EST, so the calculated offset is 5. This works great for returning the date. However, when I filter the date column, the filter predicates are being adjusted causing unexpected results.

For example, if I set the filter to 1/15/2018, the two filter predicates passed to the Where clause on the server are: 
greater than 2018-01-15T04:59:59.000Z
less than 2018-01-16T04:59:59.000Z

Since my dates are actually 2018-01-15T00:00:00.000Z, the filter is missing them (out of range).

Please advise.


SE Sathyanarayanamoorthy Eswararao Syncfusion Team January 17, 2018 02:52 PM UTC

Hi Matt, 

We are unable to reproduce the mentioned issue on our end. Please provide the following details. 

  1. Sample data bound to the Grid and model class.

  1. Server side code example of the grid and client side code example of the grid.
 
  1. String of Grid model on the server side when filtering is performed. Please refer the screenshot how to get the stringified version of the grid model.
 
 
 

The provided details will help us to analyze the issue and provide the solution as soon as possible. 

Regards, 
Sathyanarayanamoorthy 


Loader.
Up arrow icon