Find if February has 29 days

Hello, if the users wants to select a quarter and they’re allowed to select the dates from Jan 1st till 31st of March or any day after 31st of March, by using daysBetween function in Mendix it can be achieved but when we have Feb 29 the user can select the 30th of March and it wont validate, is there any way to achieve that?
1 answers

Hi Khalil,

If you are developing on Studio Pro 9 you can use the function “calendarMonthsBetween” or if you are using older versions you can use the Java action “MonthsBetween” from the CommunityCommons Marketplace module in case calculating the period is required.

Or if you don’t need to calculate the period you can read the month from the selected date by using “parseInteger(formatDateTime($EnteredDate,'MM'))” and then validate the month.