We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Selecting Todays date in the edit forms datePicker displays yesterdays date in the e-grid

Hi

I need help with using dates in the e-grid and e-grids edit forms.

There seems to be a problem with selecting Today's date in the e-grids edit forms datePicker where the date is then displayed as yesterdays date in the e-grid.

Quite hard to replicate as I think its got to do with the time.

It might be useful just to demo implementing a date picker in the demo grid

https://ej2.syncfusion.com/aspnetcore/Grid/GridOverview#/material 

Regards


3 Replies

PS Pavithra Subramaniyam Syncfusion Team June 18, 2019 09:27 AM UTC

Hi Basil, 
 
Thanks for contacting Syncfusion support. 
 
We have validated the provided information and we suspect that in your application you are using remote data. By default, while using remote data it send(response) the date value in UTC format and it does not converted to local time zone so we request you to apply the serverTimezoneOffset as below to resolve the reported problem. 

<script> 
    ej.data.DataUtil.serverTimezoneOffset = new Date().getTimezoneOffset() / 60);   //Set the servertimezoneoffset 
</script> 
 
<ejs-grid id="Grid" allowPaging="true" toolbar="@( new List<object>() {"Add","Edit","Delete","Update","Cancel"})"> 
    <e-grid-editSettings allowAdding="true" allowDeleting="true" allowEditing="true"></e-grid-editSettings> 
    <e-grid-columns> 
        <e-grid-column field="OrderID" headerText="Order ID" isPrimaryKey="true" textAlign="Right" width="100"></e-grid-column> 
        . . . .  
    </e-grid-columns> 
</ejs-grid> 

If you still facing the sample problem then share code example or sample with data which will be more helpful for us to validate further and to provide a better solution as soon as possible. 
 
Regards, 
Pavithra S. 



BB Basil Buwalda June 18, 2019 09:12 PM UTC

Thank s for you super quick reply


PS Pavithra Subramaniyam Syncfusion Team June 19, 2019 04:34 AM UTC

Hi Basil,  

Thanks for your update. 

Please contact us if you need any further assistance. As always, we will be happy to assist you.  

Regards,  
Pavithra S. 


Loader.
Live Chat Icon For mobile
Up arrow icon