How to get StartDate and EndDate by passing month value/reference at Microflow
Team, I have an requirement to get StartDate and EndDate by passing month value/reference at Microflow. Ex: If pass month value as JAN or 01, Microflow should return StartDate and EndDate of current year. Could you pls share if you have any thoughts to acheive this. Thanks..!
My suggestion would be to use the addMonth or addMonthUTC function. The start of a month is always simple but for the end just add one month and then substract 1 millisecond. Then you do not need to do the leapyear stuff.
There are a few ways to do this:
Create a table with 3 fields: Month, End Day, End Day Leap Year – you read the table entry for your month and populate the day accordingly with the date functions
A microflow where you extract your year from your current year and use the modulus function ($Year mod 4). If the mod result is != 0, FEB/02 will have 29 as the end date, the rest is covered in an if statement