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
<cfset age = 18> | |
<cfif age GT 18> | |
You are an adult. | |
<cfelseif age LT 18> | |
You are a minor. | |
<cfelse > | |
You are 18. | |
</cfif> | |
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
<cfset age = 18> | |
<cfif age GE 18> | |
You are an adult. | |
<cfelseif age LE 18> | |
You are a minor. | |
<cfelse > | |
You are 18. | |
</cfif> | |
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="businessDaysBetween" returntype="numeric" access="public"> | |
<cfargument name="startDate" type="date" required="true"> | |
<cfargument name="endDate" type="date" required="true"> | |
<cfargument name="ukHolidays" type="array" required="true"> | |
<cfset var businessDays = 0> | |
<cfset var allDays = DateDiff("d", startDate, endDate)> | |
<cfset var checkDate = startDate> | |
<cfloop index="i" from="1" to="#allDays#"> |
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="businessDaysBetween" returntype="numeric" access="public"> | |
<cfargument name="startDate" type="date" required="true"> | |
<cfargument name="endDate" type="date" required="true"> | |
<cfargument name="ukHolidays" type="array" required="true"> | |
<cfset var businessDays = 0> | |
<cfset allDays = DateDiff("d", startDate, endDate)> | |
<cfloop index="i" from="0" to="#allDays - 1#"> | |
<cfset businessDays = businessDays + 1> | |
</cfloop> |
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="businessDaysBetween" returntype="numeric" access="public"> | |
<cfargument name="startDate" type="date" required="true"> | |
<cfargument name="endDate" type="date" required="true"> | |
<cfargument name="ukHolidays" type="array" required="true"> | |
<cfset var businessDays = 0> | |
<cfset allDays = DateDiff("d", startDate, endDate)> | |
<cfloop index="i" from="0" to="#allDays#"> | |
<cfset businessDays = businessDays + 1> | |
</cfloop> |
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="businessDaysBetween" returntype="numeric" access="public"> | |
<!--- // Your code goes here ---> | |
</cffunction> | |
<!--- Define UK Holidays for 2024 ---> | |
<cfset ukHolidays = [ | |
<!--- 2024 UK Bank Holidays ---> | |
createDate(2024, 1, 1), <!--- New Year's Day ---> | |
createDate(2024, 3, 29), <!--- Good Friday ---> | |
createDate(2024, 4, 1), <!--- Easter Monday ---> | |
createDate(2024, 5, 6), <!--- Early May Bank Holiday ---> |
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
<cfset test = ""> | |
<cfdump var="#DateFormat(test, "dd.mm.yyyy")#"> |
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
<cfscript> | |
myStruct = {}; | |
myStruct[ 1 ] = { "iso" : "de", "dir" : true, "label" : "Englisch" }; | |
myStruct[ 2 ] = { "iso" : "de", "dir" : true, "label" : "Deutsch" }; | |
myStruct[ 3 ] = { "iso" : "de", "dir" : true, "label" : "Französische" }; | |
result = SerializeJSON( myStruct ); | |
writeDump( result ); | |
</cfscript> |
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
<cfscript> | |
myStruct = {}; | |
myStruct[ 1 ] = { "iso" : "de", "dir" : true, "label" : "Englisch" }; | |
myStruct[ 2 ] = { "iso" : "de", "dir" : true, "label" : "Deutsch" }; | |
myStruct[ 3 ] = { "iso" : "de", "dir" : true, "label" : "Französische" }; | |
result = SerializeJSON( myStruct ); | |
writeDump( result ); | |
</cfscript> |
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
<cfscript> | |
xmlObj = xmlParse( '<Ortus><Products></Products></Ortus>' ); | |
products = [ "BoxLang", "CommandBox" ]; | |
root = xmlObj.xmlRoot.Products.xmlChildren; | |
for( i = 1; i <= products.len(); i++ ){ | |
product = xmlElemNew( xmlObj, "Product" ); | |
product.xmlText = products[ i ]; | |
// Below will pass when uncommented | |
// xmlObj.xmlRoot.Products.xmlChildren.append( product ); | |
xmlObj.xmlRoot.Products.xmlChildren[ i ] = product; |
NewerOlder