Mendix Date/Time Variable Conversion

0
Hi, I am trying to create a dashboard (data grid) that captures all the forms completed by users via a Microflow, this form includes  a current date/time attribute value and I want to find a way to mark them against each month in a different format (jan-dec). Subsequently,I have created a non persistable entity that includes each month of the year (jan,feb,mar, etc.) I have made a microflow to create this, do I need to create a variable for each month of my non persistable entity and if I do, what expression do I need to use to covert this string month value (jan, feb, march) to represent the actual months? Here is what I have so far: $Log/Jan = parseDateTime(($Year + '01' ), 'yyyy, mm') Not sure what else I need to add after this part if I want the above value to equal the month of January? Thanks,
asked
5 answers
2

Just create an enumeration for each month and do not use any date time function. Then create the twelve objects where you set each object with the right enum value. Then show those twelve objects.

Regards,

Ronald

 

answered
1

Hi, Arunkumar,

To help clarify, I have an app where an user will completes a maintenance check via a form. Within that form/entity, it uses a log date attribute that references the current system date/time.

I am needing to try and report on this, so through a datagrid I want to list every month of the year so that when a user completes a form for this date the April month on the datagrid gets checked as completed, so if I went in next month to do another check as the same user, the May month would get checked as completed. 

That’s why I am trying to look into the non-persistable entity to use the attributes within that as the months of the year but am struggling to find the logic to do this.

Hope this helps?

Thanks

answered
0

Hi Daniel,

Can you explain in detail to get clarity. If possible share some screenshots too

answered
0

Hi Daniel,

Create a entity with Month name (String) and IsCompleted (Boolean). 

Create 12 objects for all months and display them in a datagrid.

When user completes the maintenance form, get the month value from log date and Retrieve the respective month from the new entity and mark the IsCompleted to true.

Get Month Value from date attribute, use following expression. Create a String value and put the following expression

formatDateTime($Date,’MMM’) 

answered
0

Hi daniel,

    You can also create a small generic microflow with a string variable as input, and a DateTime variable as output. In the microflow you create the DateTime variable with the parseDateTime function with the input string variable.

 

answered