While integrating a new feature for a client to flag customers that were requesting vouchers to be reissued, a business rule was required to determine whether the action should be performed during the current or next month. My client indicated that anything flagged during the last week of a month should be allocated towards the next month.
This wasn't a complex request, but there's no built-in function in ColdFusion for it. There's also no UDF available in CFLib.org DateLib... so here it is. Hopefully it will save someone some time and effort.
Without passing any options, it will use the current date & year. An option to include the weekend as part of the decision has been added.
Source Code
https://gist.github.com/JamoCA/cb8bd3f92d9b52ab97e376a6e7c32906
Top comments (0)