
DataChangedEvent range not changing
Hello, I'm using migcalendar and I need to extract startDate and endDate from DataChangedEvent when I creates an activity by dragging in the day/days date area.
I noticed that, no matter how big is my dragging rectangle, endDate is ALWAYS 30 minutes after start date. For example if I create an activity for tomorrow from 10am to 12am, I see in the DataChangedEvent that
startDate is 07-22-2011 10:00:00 and endDate is 07-22-2011 10:29:59, even if in the panel the activity rectangle is from 10am to 12am.
So I tried to debug your BeanDemo example, I put a breakpoint in AppFrame on line 1228, where is the code :
Code:
// This is the code that creates an activity by dragging in the day/days date area.
if (evt.getType() == DateChangeEvent.PRESSED) {
if (newCreatedAct == null && evt.getNewRange().getMillisSpanned(false, false) > 45*60*1000) {
newCreatedAct = new DefaultActivity(evt.getNewRange(), new Long(new Random().nextLong()));
newCreatedAct.setSummary("New Event");
newCreatedAct.addCategoryID(homeID, -1);
ActivityDepository.getInstance(dayDateArea.getActivityDepositoryContext()).addBrokedActivity(newCreatedAct, this, TimeSpanListEvent.ADDED_CREATED);
}
inspecting "evt.getNewRange().getMillisSpanned(false, false)" I found that it's always 1799999 milliseconds, no matter how tall is the activity rectangle that I drag.
I wonder wether this is a bug or I'm missing something.
Thanks