You need to sign in to do that
Don't have an account?
Michaelp
Limit date Field
Hello, Is it possible to limit the data field to Month and Year only?I am trying to create a visual force page that has a to and from date.But would like to show only Month and Year to the User.
Hi Michael,
you cannot format the date field directly, but you can create 2 seperate outputText tag with the date merge field as follows:
<outputText value="{!dateField.month}" /> <outputText value="{!dateField.year}" />
-A J
Alternatively, especially for output, you could just have the controller return a string...
//Controller public String getMonthYear() { return String.valueOf(myDate.month()) + '/' + String.valueOf(myDate.year()); } // Page <apex:outputText value="{!monthyear}" />
I would do this way
<apex:column >
<apex:facet name="header">Registration Date</apex:facet>
<apex:outputText value="{0,date, dd MMM yyyy}">
<apex:param value="{!Opp.Registration_Date__c}" />
</apex:outputText>
</apex:column>