mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
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:
parent
e7781ae3d8
commit
957e179e63
|
@ -231,17 +231,19 @@ public abstract class ResultHandler {
|
||||||
String description) {
|
String description) {
|
||||||
Intent intent = new Intent(Intent.ACTION_EDIT);
|
Intent intent = new Intent(Intent.ACTION_EDIT);
|
||||||
intent.setType("vnd.android.cursor.item/event");
|
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;
|
boolean allDay = start.length() == 8;
|
||||||
if (allDay) {
|
if (allDay) {
|
||||||
intent.putExtra("allDay", true);
|
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("title", summary);
|
||||||
intent.putExtra("eventLocation", location);
|
intent.putExtra("eventLocation", location);
|
||||||
intent.putExtra("description", description);
|
intent.putExtra("description", description);
|
||||||
|
|
Loading…
Reference in a new issue