Issue on Dates

Hi,
I have two different issues related to dates on grid:
1) I have two date/time columns (created_at and updated_at) which return a timestamp from a database. I want to render the columns in a dd/MM/yy format, but sometimes the grid randomly ignores the formating and display the columns as per Pic1. Here is how I'm formating the columns:
              <e-column
                field='created_at'
                headerText='Created At'
                type='date'
                format='dd/MM/yy'
                skeleton='short'
                width='150'
              ></e-column>
              <e-column
                field='updated_at'
                headerText='Updated At'
                type='date'
                format='dd/MM/yy'
                skeleton='short'
                width='150'
              ></e-column>

2) On another grid, I have a column called need_date which returns a date in the format yyyy-mm-dd from the database, and some of those values might be null. When trying to filter the data on that column the spinner runs indefinetly and the filtering data never gets displayed. See Pic2.
<e-column field='need_date' headerText='Need Date' width='150' type='date' format='dd/MM/yy' editType='datepickeredit' :edit='dateParams'></e-column>

dateParams: { params: { format: 'dd/MM/yy'value: new Date() } },



Attachment: Downloads_c97f4aa4.zip

7 Replies

SK Sujith Kumar Rajkumar Syncfusion Team January 22, 2021 07:27 AM UTC

Hi Christian, 
 
Greetings from Syncfusion support. 
 
We checked your reported problem and based on that would like to let you know that the date column values present in the Grid’s data source needs to be in Date object format as the date column operations(like, filtering, sorting, etc.) are done on the basis of date objects in the source-level. This is the Grid’s default behavior. So, please provide the date values in Date object format to resolve your reported problem. 
 
We have prepared a sample based on this for your reference. You can find it below, 
 
 
Please get back to us if you require any further assistance. 
 
Regards, 
Sujith R 



CD Christian DAquino January 23, 2021 11:55 AM UTC

Hi Sujith,

Even after changing the value to date object I sometimes still get the same data object resulting showing on the grid instead of the formatted dd/MM/yy result.


SK Sujith Kumar Rajkumar Syncfusion Team January 25, 2021 08:36 AM UTC

Hi Christian, 

We are not able to reproduce the reported problem from our end with the provided information, so can you please share us the following details to validate further on this, 

  • Is this case reproduced in the sample we had shared? If so can you please let us know the replication steps for the same and if not let us know the exact replication procedure to reproduce this case from our end.
  • Sample data that you have bound in the Grid.
  • Syncfusion package version used in your application.
  • Have you bound local or remote data to the Grid? If remote data which adaptor have you used.
  • If possible share us a sample to replicate the problem or try reproducing it in the previously shared sample.

Let us know if you have any concerns. 

Regards, 
Sujith R 



CD Christian DAquino January 29, 2021 07:25 AM UTC

This seems to be related foreign keys columns. My grid has about half a doze of columns with foreign keys and I'm bringing their data through half a doze of axios calls. But even if I call the grids refresh after all those calls are resolved, the dates columns still doesn't render correctly. 




SK Sujith Kumar Rajkumar Syncfusion Team February 1, 2021 05:35 AM UTC

Hi Christian, 
 
We checked the reported problem with foreign key columns but still could not reproduce the same from our end. You can check the below updated sample for your reference, 
 
 
So please share us the following information as requested in the previous update to check with your exact problem scenario, 
 
  • Sample data that you have bound in the Grid for the dataSource and foreign key columns.
  • Have you bound local or remote data to the Grid? If remote data which adaptor have you used.
  • Grid code file.
  • If possible share us a sample to replicate the problem or try reproducing it in the previously shared sample.
 
Regards, 
Sujith R 



CD Christian DAquino February 1, 2021 09:05 AM UTC

Hi Sujith,

My project is fairly complex to be shared here. The difference is that you're reading your foreign keys synchronously from your data source file. And in my case I'm reading them from axios (which means asynchronously) and that's where the issue comes from.


SK Sujith Kumar Rajkumar Syncfusion Team February 2, 2021 06:58 AM UTC

Hi Christian, 
 
Based on the provided information and shared code snippet, we could see that you are dynamically binding the foreign key column to the Grid’s column property. So can you please let us know where you are performing this action in your application along with the code snippet for the same in order to validate with your exact scenario. 
 
Regards, 
Sujith R 


Loader.
Up arrow icon