We have updated Flexmonster Software License Agreement, effective as of September 30, 2024. Learn more about what’s changed.

AnyDate.Month Show as number and group

Answered
Jean Teran asked on August 12, 2024

Your current behavior when the system takes a date and split it in .Day, .Month and .Year is awesome and very useful, related to this my question is, Could we switch the .Month from Month name (January) to Month number (1).

I tried to created and group this dates like (image 1):

Import Process Date is type: "date" (is splitting .Day, .Month & .Year).

Import Process Date (Full Date) is type "date string" formatted "MM/dd/yyyy".

Import Process Date.Month (number) is type "date string" formatted "M" with an interval settled as "M".

 

Mapping code (image 2)

But the system is not grouping as the normal .Month, it is creating a month number by each year in the range.

 

Is posible make that this Import Process Date.Month (number) works as the normal date.Month split, that it is grouping by one name. (image 3)

 

5 answers

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster August 13, 2024

Hello, Jean!

Thank you for reaching out to us. We are happy to hear our date feature is useful for you.

Kindly note that the pattern for date string field is applied only for the date labels on the grid, and there are still full dates underneath. Therefore, even if on the grid it shows 1 for both month names, for Flexmonster it still has two different values as 2024-01-01 and 2023-01-01.

Regarding the Date field that is split into three fields Date.Year, Date.Month and Date.Day, it is created from one date field and is treated by Flexmonster as one separate instance. So, if we have correctly understood the described case, it is not possible to replace Date.Month with Date.Month(number) with behavior of Date.Year and Date.Day remaining the same.
However, it is possible to change the literal months' representation to numeric, e.g., by changing the localization.

We have also noticed that you are interested in Flexmonster Data Server. Please note that the feature of splitting the date into three fields is available only for json and csv data sources, and is not available for api data source out of the box.

Hope you will find our answer helpful.
If there are any further questions, it would be helpful for us to have more details about the use case.

Looking forward to hearing from you.

Kind regards,
Solomiia

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster August 20, 2024

Hello, Jean!

Hope you are doing well.

Our team is wondering if you had some time to look through our previous response about managing date types in Flexmonster. Could you please let us know if you have any further questions?

Looking forward to hearing from you.

Kind regards,
Solomiia

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster August 27, 2024

Hello, Jean!

Hope you are having a great week.

Just checking in to ask if you have any further questions about managing date types in Flexmonster.

Looking forward to hearing your feedback.

Kind regards,
Solomiia

Public
Jean Teran September 26, 2024

Thanks for your answers they were very useful, you are right I'm trying to implement the FM Data Server, I'd like to know how obtain the same behavior of dates (Date.Day, Date.Month and Date.Year)? using the api datasource, how I can group dates into a month for example

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster September 27, 2024

Hello, Jean!

Thank you for reaching out to us.

Kindly note that the Data Server works only with the fields from the data source. So, we recommend having separate fields for year, month, and day, or just full date + separate field for month in the JSON/CSV file that is loaded into the Data Server. Then, you can group these fields in a folder or create a multilevel hierarchy using mapping on the client side.

I have prepared a JSFiddle to illustrate the idea: https://jsfiddle.net/flexmonster/m8Ltc2v5/.

Hope the suggested approach will work for your case.

Kind regards,
Solomiia

Please login or Register to Submit Answer