0

I want to create a timesheet table in which the column header contains Day and dynamically changing date. For example, if a user selects 2/1/2015 as the Start date that is Sunday, I want to show columns with header Sunday 1/2/2015, Monday 2/2/2015.

I have used the following code :

<apex:column headerValue="Monday" style="width:50px;" > 
 <apex:outputText value="{0,date,MM'/'dd'/'yyyy}"> 
  <apex:param value="{!timesheet.EnterDate__c +1}" /> 
 </apex:outputText> 
 <apex:inputField value="{!t.Monday__c}" style="width:50px;"/> 
</apex:column>
2
  • 1
    Can you add what you've tried to your question? Feb 3, 2015 at 15:34
  • Thanks for including your current code, but that doesn't explain what output it gives you (why it's wrong) Feb 3, 2015 at 19:23

1 Answer 1

0

It looks like that outputText is properly formatted, so I think what you're going for is to have that in the Column header, correct? If that's the case, then try this:

<apex:column width="50px" >
    <apex:facet name="header" >
        <apex:outputText value="Monday {0,date,MM'/'dd'/'yyyy}"> 
            <apex:param value="{!timesheet.EnterDate__c +1}" /> 
        </apex:outputText>
    </apex:facet>
    <apex:inputField value="{!t.Monday__c}" style="width:50px;"/> 
</apex:column>
2
  • Thanks a lot!!! That was exactly what I was looking for.
    – confused
    Feb 3, 2015 at 20:30
  • No problem. Upvote please :) Feb 3, 2015 at 20:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .