Appointment issue

34 views
Skip to first unread message

dsr

unread,
Apr 9, 2011, 8:31:59 AM4/9/11
to gwt-cal
Hi, I have some problem with adding some Appointment:

Date date = new Date();
date.setHours(13);
Calendar calendar = new Calendar();
calendar.setDate(new Date());
calendar.setView(CalendarViews.DAY, 4);

Appointment a = new Appointment();
a.setTitle("some title");
a.setStart(date);
a.setEnd(date);
calendar.addAppointment(a);

When I use this code it adds the appointment to 8pm. Can someone help
me with this?

Vivek Ghavle

unread,
Jun 27, 2012, 6:25:29 AM6/27/12
to gwt...@googlegroups.com

Hi dsr,
try to use this code

Appointment appt = new Appointment();                                          
                DateTimeFormat calformat = DateTimeFormat.getFormat("yyyy-MM-dd hh:mm:ss");
                appt.setStart(calformat.parse("2012-06-29 04:04:05"));
                appt.setEnd(calformat.parse("2012-06-29 04:05:30"));
                appt.setTitle("CCM20125000001");
                appt.setStyle(AppointmentStyle.GREEN);
                appt.setDescription("Billing");

But make sure the date and time of start and end..
i mean edit it by your day and time
Reply all
Reply to author
Forward
0 new messages