I have a visualforce page that displays some records from a custom object. The object has a date field and text field (that displays the date in a string), only the text is displayed in the page, but I'd like to sort by the date field. I added below the visualforce page.
<apex:page standardController="Monthly_Cloud_Bill__c" recordSetVar="unused" sidebar="false">
<apex:includeScript value="{!$Resource.UtilJS}" />
<apex:form >
<apex:pageBlock >
<apex:pageMessages />
<apex:pageBlock >
Note: All modifications made on the page will be lost if Return button is clicked without clicking the Save button first.
</apex:pageBlock>
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}"/>
<apex:commandButton value="Return" action="{!cancel}"/>
</apex:pageBlockButtons>
<apex:pageBlockTable value="{!selected}" var="a" id="table">
<apex:column headerValue="Account Name">
<apex:outputField value="{!a.account__r.name}"/>
</apex:column>
<apex:column headerValue="Billing Month">
<apex:inputField value="{!a.Billing_Month_Text__c}"/>
</apex:column>
<apex:column headerValue="Forecasted Number ">
<apex:inputField value="{!a.Forecasted_Number__c}"/>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>