I need to incorporate service data into an Angular mat table with specific conditions as outlined below:
- If the difference between the start date and end date is less than 21 days, display 'dd/mm' between the 'start_date' and 'end_date' in the header.
- If the start date and end date difference is less than 70 days, show the header with the week number.
- If the start date and end date difference is greater than 70 days but less than 1 year, the header values should be displayed as month names. Data provided by the service appears as follows:
let arr =[
{
Code: 1234,
Type: first
Codedata: [{
Ward: abc,
Start_date:. 10/10/2022,
End_date : 15/10/2022
},{
Ward: xyz,
Start_date:. 15/10/2022,
End_date : 15/12/2022
}
]
}]
https://i.sstatic.net/UBKlQ.jpg
While attempting to dynamically change headers, I encountered an error indicating that the column ID could not be found with [id].