Thanks to Volker Ruof , to provide us hint in cracking below rule.
In this blog, am going to explain how we can control users from applying leave/absence on a particular date using simple “Month of Year” and “Day of Month” function in the rule.
These scenarios may come in when there is an integration to HCM in place, where certain date/absence should not be combined and they want EC to send it separately.
- Users should apply for separate absence/leave on 05th June, should not be a combined leave.
- Users not allowed to take leave from 04th to 07th of June, because 05th June falls in between those days, or whatever the start date and end date of the absence, 05th June should not be combined, it should be applied separately only.
Take Rule using the function “Month of Year” and “Day of Month”
- Users are not allowed to apply for leave/absence from 05th to 07th of June, because 05th has to be applied separately only.
- ie. start date should not be 05th June.
- Users are not allowed to apply for leave/absence from 04th to 05th of June, because 05th has to be applied separately only.
- ie. end date should not be 05th June.
The tricky one what if Users are not allowed to combine 31st Dec along with other date/absence and should apply a separate leave for 31st Dec !!
31st Dec is the year-end and the next date goes to next consecutive year.
Hope this helps someone, where we can achieve complex scenarios using simple rule functions.