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.
Does this help?
https://docs.mendix.com/refguide/end-of-date-function-calls/#4-endofmonth
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 :)
Hi Shubhransh,
the expression formatDateTime($yourDateValue, 'MM-dd') will do the trick.
Good luck with it,
Jan