DataOperations.PerformFiltering not working properly with DateTime type

Hi,

I'm trying to perform filtering in a grid on a DateTime value.
When i pass data to controller i get the right date, but as text, as shown below

BEFORE.png

After the data get processed through the PerformFiltering function, the text date value get parsed, becoming a DateTime object but with incorrect value, it always get the specified date 2 hours earlier

AFTER.png

what can i do? i can't access the function so i don't know how the parsing is happening nor i can edit it
Syncfusion version is 20.1500.0.52


3 Replies 1 reply marked as answer

SI Santhosh Iruthayaraj Syncfusion Team June 27, 2023 10:09 AM UTC

Hi Marco,


Greetings from Syncfusion support.


From your query, it appears that the DateTime is consistently two hours earlier. Our analysis suggests that this discrepancy might be due to a difference in time zones between the server-side and client-side configurations.


To adjust the time zone on the client-side, we recommend utilizing the DataUtil.serverTimezoneOffset property. Here's an example of how you can implement it in your CSHTML file:


[CSHTML]

 

<script>

    ej.data.DataUtil.serverTimezoneOffset = +2;

    .  .  .  .  .

</script>

 


We believe that implementing this solution will help you resolve the issue you're facing. If you have any further questions or require additional assistance, please let us know.


Regards,

Santhosh I



MA Marco June 27, 2023 01:46 PM UTC

Hi Santhosh,
thank you for replying.

Unfortunately, the solutions proposed it's not working. I already tried changing the timezone setting in client-side configuration, even tried using values like +7 to see if it actually changed something and it did not. The value on back-end gets parsed always 2 hours earlier.

I also tried specifying time in the before parse date string (using the screenshots date example: "11/10/1951 00:00:00"), without any luck, still getting the 2h earlier problem.

What can i do?



MA Marco June 28, 2023 10:47 AM UTC

I litterally tried everything. Setting thread culture to en-US, it-IT (server is in italy), en-EN, invariantculture, but the 2h problem kept happening.

The thing that worked was downgrading syncfusion version... From .dll version  20.1500.0.52 to 19.4500.0.54


Marked as answer
Loader.
Up arrow icon