+ Start a Discussion

Formatting Date Error

Hi guys need a lil bit help with date formatting


<apex:outputText value="{0,date,MM'/'dd'/'yyyy}">
<apex:param value="{!i.Date_of_Incident__c}" />



this is the code i am using in visual force to format the date but i want to put blank spaces when Date_of_incident__c is empty

but when it ry to do that it gives error that param value expect some numbers please.


Please Help!


{IF(!i.Date_of_incident)__C!=NULL), display formatted date,'                  '}

Thanks in Advance

<apex:outputText value="{0,date,MM'/'dd'/'yyyy}" rendered="{!NOT(ISBLANK(i.date_of_incident__c)}">
<apex:param value="{!i.Date_of_Incident__c}" />
<apex:outputText value="" rendered="{!ISBLANK(i.date_of_incident__c)}"/>

 Use rendered= attribute to decide when to use outputText formatting