Datetime in Milliseconds not displaying in Grid


I have data where the datetime is in milliseconds (from epoch) and the grid cannot display the datetime with   [format] = { type: dateTime, format: "dd/MM/yy hh:mm:ss" } (nothing is shown/the grid will not show any data if the datatime column is defined ) but the same datasource is working well with Chart control.  Is this a bug?


Angular 8 with EJS2 controls 
Syncfusion Grid version 17.3.27
Syncfusion Chart version 17.3.27.



1 Reply

PK Prasanna Kumar Viswanathan Syncfusion Team February 17, 2020 09:33 AM UTC

Hi Albert, 
 
Greetings From Syncfusion Support. 
 
Based on your query we have prepared a sample of Grid and define a date column Format as hours, minutes and seconds to reproduce the issue. The Grid has been rendered and the date column was displayed in the defined format, so it works fine from our end.  
 
Please refer the below code example and sample for more information. 
 
App.component.ts 
 
export class AppComponent { 
    public data: Object[]; 
    public initialPage: Object; 
    public formatoptions: Object; 
 
    ngOnInit(): void { 
        this.data = [            //Grid datasource 
          .  .  .  .  .  .  . 
          { OrderID: 10248, CustomerID: "Ana Trujillo", Freight: 32.38, OrderDate: new Date (2018, 2, 13, 20, 20, 10) }, 
          { OrderID: 10249, CustomerID: "Antonio Moreno", Freight: 11.61, OrderDate: new Date (2018, 2, 14, 13, 15, 30) }, 
          .  .  .  .  .  .  . 
        ]; 
        this.initialPage = { pageSizes: true, pageCount: 4 }; 
        this.formatoptions = { type: 'dateTime', format: "dd/MM/yy hh:mm:ss" } 
    } 
} 
 
App.component.html 
 
<ejs-grid [dataSource]='data' allowPaging='true' height=365 [pageSettings]='initialPage'> 
        <e-columns> 
            .  .  .  .  .  .  . 
            <e-column field='OrderDate' headerText='Order Date' width='130' [format]='formatoptions' textAlign='Right'></e-column> 
           .  .  .  .  .  .  . 
        </e-columns> 
    </ejs-grid> 
 
 
 
If you still have the issue, Please share the below details that will be helpful for us to provide better solution 
 
1. Please share the replication procedure step by step. 
 
2. We are maintaining a datasource as dateObject for Date column (OrderDate: new Date (2018, 2, 13, 20, 20, 10)). Please share your date column datasource format. 
 
3. If possible please reproduce the issue with our above attached sample. 
 
Regards, 
Prasanna Kumar N.S.V 


Loader.
Up arrow icon