Following is my custom object controller in Apex. I think it will work fine with the data coming from VF page. But what for the variable `datesFromCalendar` which contains the contents of JS array. How to save this variable in salesforce?

```
public with sharing class EventsPageController {
    public Event__c Event {get; private set;}
    public String datesFromCalendar {get; set;}
    public pagereference saveData(){
        System.debug(datesFromCalendar);
        try {
            upsert(Event);
        } catch(System.DMLException e) {
            ApexPages.addMessages(e);
            return null;
        }
        // After Save, navigate to the default view page:
        return (new ApexPages.StandardController(Event)).view();
    }
}

```

Following is the VF code.

```
<apex:form>
    <apex:pageMessages id="errors"/>
    <apex:pageBlock title="Event Scheduler" mode="edit">
    <apex:pageBlock title="Event Detail" mode="edit" id="criteria">
        <apex:inputField id="eventType" value="{!Event.Event_Type__c}" required="true"/>
        <select name="occurrence" id="occurrence">
            <option>Select Occurrence</option>
            <option value="0">One Time</option>
            <option value="7">Weekly</option>
            <option value="30">Monthly</option>
            <option value="15">Bi-Monthly</option>
        </select>

    <input type="text" name="event_start_date" id="from" placeholder="On or after" style="height:20px; width:200px;"/>
    <input type="text" name="event_end_date" id="to" placeholder="On or before" style="height:20px; width:200px;"/>
    <apex:inputField id="eventDescription" value="{!Event.Event_Description__c}"/>
    <apex:inputField id="maxAttendees" value="{!Event.Maximum_Attendees__c}" required="true"/>
    <apex:inputField id="progName" value="{!Event.Program_Name__c}" required="true"/>
    </apex:pageBlock>
    <apex:pageBlock title="Calendar" id="calendarBlock">
    <div align="right">
        <select id="selectedDates" style="visibility:hidden"></select>
        <button id="saveCalendar"><span>Save Calendar</span></button>
        <apex:inputHidden value="{!datesFromCalendar}" id="hiddenDatesCollector"/>
        <apex:actionFunction name="passDatesToController" action="{!saveData}" rerender="hiddenDatesCollector"/>
    </div>
    <div>
        <apex:commandButton id="saveEventBtn" value="Save Event" onclick="sendSelectedDates(); return false;"/>
    </div>
    <div id="myCalendar"></div>
    </apex:pageBlock>
    </apex:pageBlock>
</apex:form>

```