How to calculate end date of a month from given CurrentDate

0
Hi,   How to Find month end date from given date through microflow?    
asked
4 answers
3

If your variable is $DateVar, you can find the month end date with this formula:

addSeconds(addMonths(trimToMonths($DateVar),1),-1)

You can find date functions here in the Mendix documentation.

answered
1

Does this help?

https://docs.mendix.com/refguide/end-of-date-function-calls/#4-endofmonth

answered
0

Hi Shubhransh,

You can get the number of the month from formatDateTime($DateValue,'M'). Firstly store this number in a string variable  and another string variable for year formatDateTime($date,'yyy'). Then you should add decisions to get the end date. 
To do that, check the number if it is 2. If it is 2 then you need to do calculation for leap year. If it is not  2 then in false condition add another decision to check the number is 1 or 3 or 5 depend on 31  dates months like jan, march. Even if that is also false then the end date must be 30.
To set the date create a string  31+'-'+$month(from the variable)+'-'+year(from Year variable). Then use this value with parseDateTime($valueYouGot,'dd-MM-YYYY').

Hope this Helps :)

 

 

 

answered
0

Hi Shubhransh,

 

the expression formatDateTime($yourDateValue, 'MM-dd') will do the trick.

 

Good luck with it,

Jan

answered