-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] Appointments over multiple day shrink to one day #50
Comments
I think the bug is in ProcessVEvent.java around line 249: The assumption that all-day-events always only span one day is wrong... |
OK - I have to correct my last message: I forked the git-repo some night-hours ago and build a quick and dirty fix: String endTz = Events.EVENT_END_TIMEZONE;
if (endTz == null) {
endTz = Events.EVENT_TIMEZONE;
}
Date dateEnd = getDateTime(cur, Events.DTEND, endTz, cal);
if(dateEnd.getTime() % 86400000 == 0){
dtEnd = new DtEnd(utcDateFromMs(dateEnd.getTime()));
} else {
dtEnd = new DtEnd(utcDateFromMs(start.getTime() + DateUtils.DAY_IN_MILLIS));
}
l.add(dtEnd); If I replace line 333 and 334 with that code i have a working solution for me BUT THIS MIGHT BE A BAD SOLUTION FOR OTHER CASES! So don't copy that code as a final bugfix (that's why I won't start a pull request with that code either...) |
After a few crashes and tests i just refined my code a bit. It's quite more to read, but it handles more (and some common) cases: String endTz = Events.EVENT_END_TIMEZONE;
if (endTz == null) {
endTz = Events.EVENT_TIMEZONE;
}
Date dateEnd = getDateTime(cur, Events.DTEND, endTz, cal);
if(dateEnd == null || dateEnd.getTime() < start.getTime()+DateUtils.DAY_IN_MILLIS){
dtEnd = new DtEnd(utcDateFromMs(start.getTime() + DateUtils.DAY_IN_MILLIS));
} else {
if(dateEnd.getTime() % DateUtils.DAY_IN_MILLIS == 0){
dtEnd = new DtEnd(utcDateFromMs(dateEnd.getTime()));
} else {
Long dateEndCorrection = 0L;
if(dateEnd.getTime() % DateUtils.DAY_IN_MILLIS >= (DateUtils.DAY_IN_MILLIS/2L)){
dateEndCorrection = (DateUtils.DAY_IN_MILLIS - (dateEnd.getTime() % DateUtils.DAY_IN_MILLIS));
} else {
dateEndCorrection = (-dateEnd.getTime() % DateUtils.DAY_IN_MILLIS);
}
dtEnd = new DtEnd(utcDateFromMs(dateEnd.getTime() + dateEndCorrection));
}
}
l.add(dtEnd); PS: PPS: exit("Good night") |
@mitras2 thanks for the great report. I'll try to look at this this weekend, no doubt some test cases will be needed. |
@jgriffiths: Did you gain any progress? The nasty bug which prevents this app to be used as an stable importer/exporter still exists :( |
Hi @doak unfortunately I have been very busy with work. I will try to take some time to look at recent reports this weekend. |
Hey there, Thanks, |
The code was creating a datetime object, but all day events should have a date object for both the start and the end dates. Fixes SufficientlySecure#50
If an event's start date is a date (and not datetime) we can assume the end date would be one too, and that means it's an all day event. The previous code was forcing the event to be a one day event although this was completely unnecessary. Fixes SufficientlySecure#50
@tasn So is this Problem fixed now? |
It's fixed in my pull request (#64), though not yet merged. |
@tasn: Thank you very much! I am just waiting to get v2.5 available on F-Droid .. ;)
Regards,
doak
…On 12 March 2017 16:17:06 CET, Tom Hacohen ***@***.***> wrote:
It's fixed in my pull request (#64), though not yet merged.
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#50 (comment)
|
@doak, same here. At least it's available on Google Play for now. |
I pinged the F-Droid guys on IRC. App page says "build failed", but logs says "build suceeded" O_o |
Looks good now according to the wiki. Oops, didn't mean to send yet. Edit: thanks. :P |
Confirmed, just got the F-Droid update: it works. Thanks all lot! Regards, |
This is the problem:
I exported an calendar with appointments that span over multiple days. Some of them have date+time for beginning and end. Others are define to be on from day x to y (complete day).
While the appointments with date+time stay spanned over multiple days, the other ones that are defined for the complete days are shrunk down to the first day.
Example:
LAN-Party
from 15.07.2016 10:00
to 17.07.2016 18:00
becomes:
BEGIN:VEVENT
...
SUMMARY:LAN-Party
ORGANIZER:mailto:[email protected]
LOCATION:Somewhere
STATUS:CONFIRMED
DTSTART;TZID=Europe/Berlin:20160114T100000
DTEND:20160717T180000Z
END:VEVENT
4 days of Filming
from 25.07.2016
to 28.07.2016
becomes:
BEGIN:VEVENT
...
SUMMARY:4 days of Filming
ORGANIZER:mailto:[email protected]
LOCATION:Somewhere
STATUS:CONFIRMED
DTSTART;VALUE=DATE:20160725
DTEND;VALUE=DATE:20160726
END:VEVENT
Version is 2.3
on Android 4.4.3
The text was updated successfully, but these errors were encountered: