Hello.
Is there any way to send hours and minutes to the server from calendar?
I use JSON as a data format.
Request to the server - after saving event - is like this:
"GET /add_event?startDate=2008-12-30&endDate=2008-12-30&name=aaa&description= HTTP/1.1".
I don't know how to send startHours, startMinutes, endHours, endMinutes.
My datasource is:
----------------------------------------------------------------
setDataFormat(DSDataFormat.JSON);
setDataURL(URLF);
OperationBinding fetch = new OperationBinding(DSOperationType.FETCH,
URLF);
fetch.setDataFormat(DSDataFormat.JSON);
add = new OperationBinding(DSOperationType.ADD, URLA);
add.setDataFormat(DSDataFormat.JSON);
OperationBinding upd = new OperationBinding(DSOperationType.UPDATE,
URLU);
upd.setDataFormat(DSDataFormat.JSON);
remove = new OperationBinding(DSOperationType.REMOVE,
URLR);
remove.setDataFormat(DSDataFormat.JSON);
setOperationBindings(fetch, add, upd, remove);
DataSourceSequenceField idField = new DataSourceSequenceField("id");
idField.setPrimaryKey(true);
DataSourceTextField eventField = new DataSourceTextField("name");
DataSourceTextField descField = new DataSourceTextField("description");
DataSourceDateField startDateField = new DataSourceDateField("startDate");
DataSourceDateField endDateField = new DataSourceDateField("endDate");
DataSourceTextField startHours = new DataSourceTextField("startHours");
DataSourceTextField startMinutes = new DataSourceTextField("startMinutes");
DataSourceTextField startAMPM = new DataSourceTextField("startAMPM");
DataSourceTextField endHours = new DataSourceTextField("endHours");
DataSourceTextField endMinutes = new DataSourceTextField("endMinutes");
DataSourceTextField endAMPM = new DataSourceTextField("endAMPM");
setFields(idField, eventField, descField,
startDateField, endDateField, startHours, startMinutes, startAMPM, endHours, endMinutes, endAMPM);
----------------------------------------------------------------
Snippet of calendar:
----------------------------------------------------------------
final Calendar calendar = new Calendar();
final CalendarDS calendarDataSource = CalendarDS.getInstance();
calendar.setWidth100();
calendar.setHeight100();
calendar.setDataSource(calendarDataSource);
calendar.setAutoFetchData(true);
calendar.setShowWeekends(false);
calendar.setShowWorkday(true);
calendar.setScrollToWorkday(true);
calendar.setCanCreateEvents(true);
calendar.setCanEditEvents(true);
----------------------------------------------------------------
Thank you in advance for help.
Is there any way to send hours and minutes to the server from calendar?
I use JSON as a data format.
Request to the server - after saving event - is like this:
"GET /add_event?startDate=2008-12-30&endDate=2008-12-30&name=aaa&description= HTTP/1.1".
I don't know how to send startHours, startMinutes, endHours, endMinutes.
My datasource is:
----------------------------------------------------------------
setDataFormat(DSDataFormat.JSON);
setDataURL(URLF);
OperationBinding fetch = new OperationBinding(DSOperationType.FETCH,
URLF);
fetch.setDataFormat(DSDataFormat.JSON);
add = new OperationBinding(DSOperationType.ADD, URLA);
add.setDataFormat(DSDataFormat.JSON);
OperationBinding upd = new OperationBinding(DSOperationType.UPDATE,
URLU);
upd.setDataFormat(DSDataFormat.JSON);
remove = new OperationBinding(DSOperationType.REMOVE,
URLR);
remove.setDataFormat(DSDataFormat.JSON);
setOperationBindings(fetch, add, upd, remove);
DataSourceSequenceField idField = new DataSourceSequenceField("id");
idField.setPrimaryKey(true);
DataSourceTextField eventField = new DataSourceTextField("name");
DataSourceTextField descField = new DataSourceTextField("description");
DataSourceDateField startDateField = new DataSourceDateField("startDate");
DataSourceDateField endDateField = new DataSourceDateField("endDate");
DataSourceTextField startHours = new DataSourceTextField("startHours");
DataSourceTextField startMinutes = new DataSourceTextField("startMinutes");
DataSourceTextField startAMPM = new DataSourceTextField("startAMPM");
DataSourceTextField endHours = new DataSourceTextField("endHours");
DataSourceTextField endMinutes = new DataSourceTextField("endMinutes");
DataSourceTextField endAMPM = new DataSourceTextField("endAMPM");
setFields(idField, eventField, descField,
startDateField, endDateField, startHours, startMinutes, startAMPM, endHours, endMinutes, endAMPM);
----------------------------------------------------------------
Snippet of calendar:
----------------------------------------------------------------
final Calendar calendar = new Calendar();
final CalendarDS calendarDataSource = CalendarDS.getInstance();
calendar.setWidth100();
calendar.setHeight100();
calendar.setDataSource(calendarDataSource);
calendar.setAutoFetchData(true);
calendar.setShowWeekends(false);
calendar.setShowWorkday(true);
calendar.setScrollToWorkday(true);
calendar.setCanCreateEvents(true);
calendar.setCanEditEvents(true);
----------------------------------------------------------------
Thank you in advance for help.
Comment