🍉 Meet Flexmonster Pivot Table & Charts 2.9.Check out all hot features!
Get Free Trial

When using type: 'datestring' hierarchial data the field list order is wrong

Courtney Chow asked on September 3, 2019

We are using some ‘date string’ time data and the datePattern is ‘yyyy-MM-dd’. One very strange behaviour is that in the field list panel, the date sub fields of a field is displayed in the order Year, Day, Month, but we want Year, Month, Day. In the demo the order is Day, Month, Year. Where shall I specify the order? I can’t find the related doc.

2 answers

Vera Didenko Vera Didenko Flexmonster September 3, 2019

Hello, Courtney,
Thank you for writing to us.
We would like to explain that the date string JSON date data type is not a hierarchical type. Date fields of such type are displayed as a single string.
If the date, year/month/day, or year/quarter/month/day JSON date data types are used, date fields will be split.
An important remark is that the datePattern property can be used to specify how the date should be displayed for date fields of type date string.
The datePattern property doesn’t affect date fields of other date data types.
For your case, we kindly suggest checking out the year/month/day date data type.
Here is a JSFiddle example for illustration: https://jsfiddle.net/flexmonster/jso6370u/.
Please let us know if this works for you.
You are welcome to contact us in case of questions.
Best Regards,

Courtney Chow September 4, 2019

Hi, Vera,
I meant “date” when I say “date string” in the original question. But the problem is there. Surprisingly, changing the type from “date” to “year/month/day” fixed it – the order is now correct!

Please login or Register to Submit Answer