The IOC Wildcard Pack now includes a DateAdd and DateFormat functions.
Date Add
Date Add allows units of time (typically days) to be added or subtracted from dates returned by wildcards. The Date Add functionality is useful for displaying deadlines relative to things like I-20 End Date, OPT End Date, etc.
Date Add format example: %ioc_dateadd(‘d’,-30,%ioc_clientdob%)%
-
- The DateAdd function “%ioc_dateadd()%” starts and ends with percent signs and is lowercase.
- “d” in single quotes indicates days as the unit of time to added/subtracted. The IOC Date Add function mimics the ColdFusion DateAdd() function. See the ColdFusion DateAdd documentation for the proper codes for other units of time.
- “-30” is the number of time units to be added or subtracted. In this case we are subtracting 30 days.
- “%ioc_clientdob%” is the date to add/subtract the units from. IOC date wildcards should already be formatted correctly but any other dates used should be formatted like January 21, 2020.
See the ColdFusion DateAdd documentation for more details on syntax options.
Date Format
Date Format allows the date returned by the wildcard to be formatted in a specified format. Typically, the IOC Wildcard functionality returns dates in the mmmm dd, yyyy format (Ex. January 8, 2025). The default format does not work when using the wildcard to prepopulate a date field, so the date format function can be used.
Date format example: %ioc_dateformat(‘%ioc_clientdob%’,’mm/dd/yyyy’)%
- The Date Format function “%ioc_dateformat()%” must start and end with percent signs and be in lowercase
- The first argument is the date, which typically takes the form of a wildcard. It must be in single quotes. Ex. ‘%ioc_clientdob%’
- The second argument is the desired date mask (format) based on the ColdFusion dateformat function, which must be in single quotes. Ex. ‘mm/dd/yyyy’
- The first and second arguments must have a comma between them with no spaces anywhere outside of the arguments.
See the ColdFusion DateFormat documentation for more details on syntax for date formats.