Hi,
We need the field type in the table to remain as year/month/day. However, when we drag and drop "day" from the fields popup, it only displays the day value. We require it to display the entire date with the specified format. Therefore, the header should include the complete date details of that field, not just the day.
Additionally, I've reviewed the previous solution provided by the team, where cell customization was used. However, the data obtained in the parentMember only has access to the year when it is a month. When I tried the same approach for our table, I found that I only received label data.
You can find the link to the previous solution here: https://jsfiddle.net/flexmonster/zr0jd6Lo/
Could you please look into this? Thank you.
Can someone from the Flexmonster team look into this on priority, please?
TL;DR: When a date field is detected
Hello,
Thank you for reaching out to us.
To display dates with the mentioned format, we recommend the following approach:
Preprocess the data, so you have three fields with the same date. For example,
{
"DateYear": "2021-05-25",
"DateMonth": "2021-05-25",
"DateDay": "2021-05-25",
// other fields
},
Then, use mapping to set the type "date string"
and set the necessary interval
and format
:
mapping: {
"DateYear": {
caption: "Year",
type: "date string",
interval: "y",
format: "yyyy"
},
"DateMonth": {
caption: "Month",
type: "date string",
interval: "M",
format: "MMMM yyyy"
},
"DateDay": {
caption: "Day",
type: "date string",
format: "dd MMM yyyy"
}
}
Please check the following JSFiddle for reference: https://jsfiddle.net/flexmonster/qtcxpkzu/
We hope it helps. Feel free to contact us if other questions arise.
Kind regards,
Nadia
Can we avoid the Date field being split into three different fields? We need the default grouping behavior as in the image attached.
Hello,
Thank you for the response.
To group the date fields, we recommend adding the folder
property to the mapping. For example:
mapping: {
"DateYear": {
folder: "Date",
caption: "Year",
type: "date string",
interval: "y",
format: "yyyy"
},
"DateMonth": {
folder: "Date",
caption: "Month",
type: "date string",
interval: "M",
format: "MMMM yyyy"
},
"DateDay": {
folder: "Date",
caption: "Day",
type: "date string",
format: "dd MMM yyyy"
}
}
You are welcome to see the following JSFiddle for reference: https://jsfiddle.net/flexmonster/wnackj19/
Please let us know if it works for you. Looking forward to hearing from you.
Kind regards,
Nadia
Hi the above mapping is working as expected. But there is an issue with filters now. When we try to apply filters on the field, it is not working as expected. I have attached the filter attachment.
This is video link of issue: Link
Could you please look into this? Thank you.
Please check the above case @nadia. It's not just with filters, anything that has to do with the newly mapped date fields like conditional formatting, formula, etc, doesn't work.
Hello,
Thank you for the reply.
Kindly check if you have removed the previous configurations of the date fields from the mapping. In other words, please check if there are the same fields defined in the mapping with the "year/month/day"
. If present, please remove those configs. Also, there should be no fields with the same uniqueName
. Feel free to check the example: https://jsfiddle.net/flexmonster/wnackj19/. You can see that the filter works as expected.
We hope it helps. You are welcome to contact us if other questions arise.
Kind regards,
Nadia
This worked. Thanks, Nadia.
Hello,
Thank you for the response!
We are glad to hear that it works for you.
As always, do not hesitate to write to us if further questions arise.
Kind regards,
Nadia