Issue 933 handle multi-day all-day events

git-svn-id: https://zxing.googlecode.com/svn/trunk@2015 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2011-11-04 16:31:22 +00:00
parent e7781ae3d8
commit 957e179e63

View file

@ -231,17 +231,19 @@ public abstract class ResultHandler {
String description) {
Intent intent = new Intent(Intent.ACTION_EDIT);
intent.setType("vnd.android.cursor.item/event");
intent.putExtra("beginTime", calculateMilliseconds(start));
long startMilliseconds = calculateMilliseconds(start);
intent.putExtra("beginTime", startMilliseconds);
boolean allDay = start.length() == 8;
if (allDay) {
intent.putExtra("allDay", true);
} else {
if (end == null) {
end = start;
}
long endMilliseconds = calculateMilliseconds(end);
intent.putExtra("endTime", endMilliseconds);
}
long endMilliseconds;
if (end == null) {
endMilliseconds = allDay ? startMilliseconds + 86400 : startMilliseconds;
} else {
endMilliseconds = calculateMilliseconds(end);
}
intent.putExtra("endTime", endMilliseconds);
intent.putExtra("title", summary);
intent.putExtra("eventLocation", location);
intent.putExtra("description", description);