I was working on a project, and I needed to write a new function which calculates yesterday’s date and if yesterday was a Sunday, the function needed to return last Friday’s date. The first part of my function checks to see if the date supplied to the function is at least Tuesday. If the date passes that check, then we subtract one from the date and return the date.
If the date failed the first check, then we subtract 7 from the date to get a day last week, and then subtract the day of the week from that day in order to get to the beginning of the week. Finally we add 6 to that day in order to get Friday.
[cffunction name="getLastWorkDay" returntype="numeric" access="private"]
[cfargument required="true" type="date" name="DateToProcess"]
[cfif DayOfWeek(fix(arguments.DateToProcess)) GT 2 ]
[cfreturn CreateDate(Year(arguments.DateToProcess),Month(arguments.DateToProcess),Day(arguments.DateToProcess-1)) /]
[cfreturn DateFormat((Fix(arguments.DateToProcess)-7) - DayOfWeek(Fix(arguments.DateToProcess)-7)+6)/]
[cfoutput]Date: #DateFormat(getLastWorkDay(now()), "dddd, mmmm d, yyyy")#[/cfoutput]
How God Makes Men: Ten Epic Stories. Ten Proven Principles. One Huge Promise for Your Life.
“All through the Bible, we see stories of bold and brash men who followed God’s call into some incredible adventures. In How God Makes Men,Patrick Morley reminds us that God still makes those kinds of guys.” —Dave Ramsey, New York Times best-selling author and nationally syndicated radio show host
You can find the first chapter of this book online at Patrick Morley’s website.
In this example, I will be using an “Announcements List,” with the default fields, and using and Windows Form App, I will load data from this list into a DataGridView. You will need to download and install the SharePoint Server 2013 Client Components SDK from Microsoft.
After you have installed the SDK, You will need to add the following two references to your project: Continue Reading
Take a moment to remember all those who died in the attack and those who survived and when on to fight in the war.
November 8, 1941, New York, New York, USA — These headlines were from a New York newspaper telling of the start of the American-Japanese war, December 7, 1941. — Image by © Bettmann/CORBIS
Are you tried of hearing that there isn’t any archaeological evidence that supports the Biblical narrative of history? Check out this video where Dr. Patton shows some of the evidence.