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

Flexmonster shows "Invalid Date" for year and month dates only if the month comes before the year

Jaime McDermott asked on August 16, 2017

We have a month formatted like the following: MM-yyyy
However, when you specify that as the dateFormat, Flexmonster shows invalidDate. If you switch it to yyyy-MM, then it works just fine.
You can see it in the following example: http://jsfiddle.net/1yv4be7n/

3 answers

Dmytro Zvazhii Dmytro Zvazhii Flexmonster August 16, 2017

Hello Jaime,
Thank you for your question. For now, the component supports the input date only in ISO-8601 format – http://www.flexmonster.com/doc/data-types-in-json/. As a workaround, we suggest setting the date data in ISO-8601 format and then adding the appropriate dateFormat pattern. Please have a look at the following example: http://jsfiddle.net/1yv4be7n/1/.
Let us know if it works for you.
Best regards,

Jaime McDermott August 16, 2017

Oh, I thing I misinterpreted your documentation. You are saying that the dateFormat is used for output formatting and not input format, right? We don’t have that much control over our input data, and it can be pretty slow to loop through the entire data set and reformat fields before giving them to the flexmonster component, but I suppose that’s what we have to do for now.

Iryna Kulchytska Iryna Kulchytska Flexmonster August 17, 2017

Hello Jaime, 
As an input date format, pivot table component supports ISO 8601 date (other formats may be used, but results can be unexpected).
For controlling the output format, the component has the following report properties: datePattern and dateTimePattern. In addition to the article Dmytro provided to you, please take a look at the following one: http://www.flexmonster.com/doc/date-and-time-formatting/
Kind regards,

Please login or Register to Submit Answer