0

I have a visual force page with an apex controller. In the controller I have a variable Date date1. In the page I have an <apex:input type="date" value="{!date1}"/>. Everything works fine.

Now I need to have only a month-year selector, no day has to be showed. One option could be to use instead two number input, or a picklist (for months) and a number (for the year) but I'd like to mantain a calendar standard element.

Is there any way?

1 Answer 1

1

You would need to use jQuery to achieve that.
The following jsFiddle has a working example. http://jsfiddle.net/bopperben/DBpJe/

This jsFiddle was created by a user on the following post. https://stackoverflow.com/questions/2208480/jquery-ui-datepicker-to-show-month-year-only

2
  • The next question is, how is it going to be stored in Salesforce?
    – Nick C
    Commented Aug 26, 2015 at 13:32
  • @Nick Cook. I agree. But since the OP mentioned that he is also considering creating 2 separate fields to capture month and year, I would assume the storage part is figured out already.
    – Aayush K
    Commented Aug 26, 2015 at 13:40

You must log in to answer this question.

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