1. <cfcomponent name="Ajax_Calendar_Functions" extends="ajax">
  2.     <cfsetting showdebugoutput="false">
  3.     
  4.     <cffunction name="getEvents" output="false" returntype="string" access="public"
  5.                 hint="returns a list of events for a selected date">
  6.         <cfargument name="eventDate" type="date" required="true" />
  7.         
  8.         <cfscript>
  9.             var returnResult = '';
  10.             var qryResult = '';
  11.             
  12.             //gset the event gateway
  13.             variables.gatewayEvents = createObject("component","eventsGateway").init(application.dsn);
  14.         
  15.             //return a query of events
  16.             qryResult = variables.gatewayEvents.getEventsByDate(dateFormat(arguments.eventDate,"mm-dd-yyyy"));
  17.         </cfscript>        
  18.         
  19.         <cfsavecontent variable="returnResult">            
  20.             <cfoutput>
  21.                 <h3>#dateFormat(arguments.eventDate,'mmm d, yyyy')#</h3>
  22.                 <p>
  23.                 <cfloop query="qryResult">
  24.                     &nbsp;&nbsp; #event_Name# -
  25.                     #timeFormat(start_date, 'short')#
  26.                     <br />
  27.                 </cfloop>
  28.                 </p>
  29.             </cfoutput>
  30.         </cfsavecontent>
  31.         
  32.         <cfscript>            
  33.             return returnResult;
  34.         </cfscript>
  35.     </cffunction>
  36. </cfcomponent>