Datetimepicker wrong time after update

Hello!

I'm having some problems with the grid and the datetimepicker control. I'm using the 22.2.8 version and working with .net 7 project.

When I save the data in the grid, it saves mi correctly the data in the database. This is the grid when editing the data

Image_8925_1692313060602

and this is the data in the database

Image_9179_1692313115139

But, when the grid needs to display then updated data after saving it, it shows me like this

Image_9852_1692313278304

Data in the database is still ok:

Image_3451_1692313310212

The time is correct OnPostUpdate in value.Value object.

Image_1362_1692313208412


So, when I just hit the F5 for the refresh on the current page, the grid shows the correct data

Image_7354_1692313394738


Maybe I'm missing some JsonSerializer options or something like that?


Thanks!

Bernard.


5 Replies 1 reply marked as answer

BJ Bernard Jurlina August 18, 2023 06:30 AM UTC

I forgot to mention that I'm using onBegin function for saving the data from the grid:


function onBegin(args) {

if (args.requestType === 'save') {

args.data.Pocetak = ejs.data.DataUtil.dateParse.addSelfOffset(new Date(args.data. Pocetak)).toISOString();

args.data.Kraj = ejs.data.DataUtil.dateParse.addSelfOffset(new Date(args.data.Kraj)).toISOString();

}

}


Regards,

Bernard.



BJ Bernard Jurlina August 18, 2023 06:44 AM UTC

This is the project example with the database.


Bernard.


Attachment: Takt_2_f751584.zip


HS Hemanthkumar S Syncfusion Team August 22, 2023 02:56 PM UTC

Hi Bernard Jurlina,


Greetings from Syncfusion support.


Upon attempting to run your provided sample, we encountered the following error. Therefore, we kindly request you verify whether the given sample is a fully functional working sample or a code snippet that only demonstrates the code. If it is intended to be a runnable sample, please furnish us with a step-by-step procedure to execute the sample successfully.


A screenshot of a computer

Description automatically generated


After reviewing your provided code, we have noticed that you are utilizing the addSelfOffset method of the DataManager during the data-saving process. In order to proceed, kindly furnish a comprehensive explanation detailing the purpose or reason behind your decision to employ the addSelfOffset method. This information will assist us in gaining a deeper understanding of your approach.


Regards,

Hemanth Kumar S



BJ Bernard Jurlina August 22, 2023 09:52 PM UTC

Hi Kumas S,


thank you for the answer. Meanwhile, I got this to work with this solution:

I added this lines in the Program.cs file


Image_6098_1692741058450

and then I remove using the  addSelfOffset  method on grid save action.


Everything is working fine now.
Thanks again for your response.

Regards,
Bernard.


Marked as answer

SG Suganya Gopinath Syncfusion Team August 23, 2023 06:44 AM UTC

Hi Bernard, 

We are glad, please get back to us for further assistance when needed. 


Loader.
Up arrow icon