<cfcomponent displayname="DateTime" output="false">
<cffunction name="DateOutput" returntype="string" hint="I return the date
formatted for output" output="false">
<cfargument name="myDateTime" type="date" required="yes">
<cfset var result = "">
<cfif DateDiff('d','1/1/1900',myDateTime) GT 0>
        <cfset result = DateFormat(myDateTime,"yyyymmdd")>
</cfif>
<cfreturn result>
</cffunction>



This works fine, except it doesn't accept an empty myDateTime.
So I suppose I need to change type="date" to type="string".

But then I'll need to verify that myDateTime is either "" or a valid date.




----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

An archive of the CFCDev list is available at 
www.mail-archive.com/[email protected]


Reply via email to