Igx-Grid: Convert datatypes – string to date
New DiscussionHello,
I have an igx-grid with a column with dates. When I try to filter the columns with the dates nothing changes. Maybe it's because I got the data from SQL database in a string format. Is it possible to display those dates from the original string format as a date format in the igx grid?
I read a similar question in the forum: https://ko.infragistics.com/community/forums/f/ignite-ui-for-angular/121906/custom-string-date-filter
Since the question was posted over 2 years ago, I would like to know if this problem is already solved and if there is a solution to it.
I tried to convert the string into a date:
for (let d = 0; d < this.myData.length; d++) {
let currentDate= this.myData[d].orderDate
let day = currentDate.substring(0, 2)
let month = currentDate.substring(3, 5)
let year = currentDate.substring(6, 10)
this.myData[d].orderDate= month + "." + day + "." + year
let convertedDate= new Date(year + '-' + month + '-' + day)
this.myData[d].orderDate= convertedDate
}
This is my igx-column:
And here is my [pipeArgs]:
public dateOptions = {
format: 'mediumDate',
timezone: 'UTC+0'
};
public formatDateOptions = this.dateOptions;
Thank you in advance.
Sign In
to post a reply
Replies
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Favorites
0 Replies
9 Created On
Dec 08, 2022 Last Post
3 years, 2 months ago 