DateFormat function inserts space in front !
Hi to all,
I recently started a brand new project in CF9.0.1 (hotfix 1 in place).
In one of my main components I have a function as per the following :
________________________________________
<cffunction name="DateFormatBE"
access="public"
returntype="string"
description="Formats a given string to Belgian date format, returns a blanco when no date is given">
<cfargument name="myDate"
type="string"
required="false"
default=""
hint="the string to date format">
<cfscript>
if (Len(Trim(ARGUMENTS.myDate))) {
if (! IsDate(ARGUMENTS.myDate)) {
ARGUMENTS.myDate = ParseDateBE(ARGUMENTS.myDate);
if (! Len(Trim(ARGUMENTS.myDate)))
return "";
}
return Trim(LSDateFormat(ARGUMENTS.myDate,"DD/MM/YYYY"));
} else
return "";
</cfscript>
</cffunction>
<cffunction name="ParseDateBE"
returntype="any"
access="public"
output="false"
hint="Parses a given string to a date object (dd/mm/yyyy).">
<cfargument name="myDate"
required="No"
type="string"
default=""
hint="the string to parse of format (dd/mm/yyyy)">
<cfscript>
if (ListLen(ARGUMENTS.myDate,"/") == 3) // expects two slashes
return CreateDate(ListGetAt(ARGUMENTS.myDate,3,"/"), ListGetAt(ARGUMENTS.myDate,2,"/"),ListGetAt(ARGUMENTS.myDate,1,"/"));
else
return "";
</cfscript>
</cffunction>
________________________________________
As of version 9.0.1 I always receive an extra space in front if I output a date as following :
<cfoutput>
<input type="Text"
name="SomeName"
value="#DateFormatBE(Now())#" >
</cfoutput>
However, this does seem to work as expected :
<cfdump var="#DateFormatBE(Now())#">
Is this a known bug or am I missing something?
Thanks for reading!
Bert.
