Commit 2256ddc6 authored by Volker Krause's avatar Volker Krause
Browse files

Use pkpass expirationDate field to guess a suitable end time for events

parent be98aaae
......@@ -215,6 +215,12 @@ static Event extractEventTicketPass(KPkPass::Pass *pass, Event event)
// "relevantDate" is the best guess for the start time
if (pass->relevantDate().isValid() && !event.startDate().isValid()) {
event.setStartDate(pass->relevantDate());
// "expirationDate" is the best guess for the end time
if (pass->expirationDate().isValid() && pass->relevantDate().date() == pass->expirationDate().date() &&
pass->expirationDate() > pass->relevantDate() && !event.endDate().isValid()) {
event.setEndDate(pass->expirationDate());
}
}
// location is the best guess for the venue
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment