1

Is there a way to add months to a date inline on a visualforce page?

Something along {!quote.ExpirationDate.addMonths(3)} is what I was thinking about but I guess the syntax isn't accepted.

2
  • Why not create formula field, adding those months, and show that in VF page instead of normal field i.e ExpirationDate in your case ? Commented Jun 22, 2015 at 15:15
  • I could and that I've already done. This question is really just out of curiosity which can help those limited in the number of available fields in their SF orgs.
    – dotmiko
    Commented Jun 22, 2015 at 15:35

1 Answer 1

2

You can use MONTH formula to get no of the Month from your date

For printing the name of the month use below

{!CASE(MONTH(quote.ExpirationDate), 1, "January", 2, "February", 3, "March",  4, "April",  5, "May",  6, "June", 7, "July", 8, "August", 9, "September", 10, "October", 11, "November", 12, "December", "None")}

You must log in to answer this question.

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