Last active
December 14, 2015 09:19
-
-
Save dannyrscott/5064455 to your computer and use it in GitHub Desktop.
This file contains 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
<cffunction name="colorPick"> | |
<cfargument name="theDate" type="date" required="true"> | |
<cfset var colors = ["red","blue","green","yellow","orange"]> | |
<cfset var index = 1/> | |
<!--- Convert the date to Unix timestamp and mod by the len of the color aray ---> | |
<cfset index = (DateDiff("d","1/1/1970",arguments.theDate) MOD arraylen(colors)) + 1/> | |
<cfreturn colors[index]/> | |
</cffunction> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment