Created
December 23, 2025 20:20
-
-
Save trycf/72cb436d4c5f5ce15e535c656b27f643 to your computer and use it in GitHub Desktop.
TryCF Gist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <cfscript> | |
| getRanges = function() { | |
| var ranges = [30, 60, 90, 180]; | |
| var today = dateFormat(now(), "mm/dd/yyyy"); | |
| return ranges.map((r) => { | |
| var start = dateFormat(dateAdd("d", -(r-1), today), "mm/dd/yyyy"); | |
| return { | |
| "range_display": "Last #r# Days", | |
| "key": -#r#, | |
| "start_date": start, | |
| "end_date": today | |
| } | |
| }); | |
| } | |
| writedump( | |
| getRanges() | |
| ); | |
| //* | |
| var today = dateFormat(now(), "mm/dd/yyyy"); | |
| in30 = dateFormat(dateAdd("d", -29, today), "mm/dd/yyyy"); | |
| writedump(today); | |
| writedump(in30); | |
| //*/ | |
| </cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment