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>
  • 1
    Can you add what you've tried to your question? – Koen Wesselman Feb 3 '15 at 15:34
  • Thanks for including your current code, but that doesn't explain what output it gives you (why it's wrong) – RenegadeCoder Feb 3 '15 at 19:23
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>
| improve this answer | |
  • Thanks a lot!!! That was exactly what I was looking for. – confused Feb 3 '15 at 20:30
  • No problem. Upvote please :) – RenegadeCoder Feb 3 '15 at 20:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.