| Get the appoints for a particular date
public XAppointment[] getAppointments( Calendar c )
{
int dayOfMonth = c.get( Calendar.DAY_OF_MONTH );
if (( dayOfMonth == 18 ) || ( dayOfMonth == 1 )){
XAppointment events[] = new XAppointment[ 2 ];
events[ 0 ] = new XAppointment();
events[ 0 ].bkColor = new Color( 252, 231, 255, 128 );
events[ 0 ].fgColor = Color.black;
events[ 0 ].title = ( dayOfMonth == 6 ) ? "Breakfast with Basil Faulty" : "Meet John Doe";
Calendar start = (Calendar)calendar.clone();
start.set( Calendar.HOUR_OF_DAY, 8 );
start.set( Calendar.MINUTE, 0 );
events[ 0 ].startTime = start;
Calendar end = (Calendar)start.clone();
end.set( Calendar.MINUTE, 45 );
events[ 0 ].endTime = end;
events[ 1 ] = new XAppointment();
events[ 1 ].bkColor = new Color( 231, 231, 255, 128 );
events[ 1 ].fgColor = Color.black;
events[ 1 ].title = ( dayOfMonth == 6 ) ? "Lunch" : "Conference call";
start = (Calendar)calendar.clone();
start.set( Calendar.HOUR_OF_DAY, 12 );
start.set( Calendar.MINUTE, 5 );
events[ 1 ].startTime = start;
end = (Calendar)start.clone();
end.set( Calendar.HOUR_OF_DAY, 13 );
end.set( Calendar.MINUTE, 45 );
events[ 1 ].endTime = end;
return events;
}
return new XAppointment[ 0 ];
}
|