Commit abefc658 authored by Volker Krause's avatar Volker Krause
Browse files

Correctly merge data from date and time input fields

This previously did the computation in UTC, which depending on the local
timezone has a chance of producing the wrong date. With the native
Android date picker this was particularly likely due to the use of
QDate::startOfDay.

BUG: 461963
FIXED-IN: 22.12.0
parent 7a5a062b
Pipeline #272135 passed with stage
in 4 minutes and 11 seconds
......@@ -39,9 +39,7 @@ Kirigami.Page {
req.from = root.departureStop;
req.to = root.arrivalStop;
const MSECS_PER_DAY = 24 * 60 * 60 * 1000;
var dt = new Date();
dt.setTime(dateInput.selectedDate.getTime() - (dateInput.selectedDate.getTime() % MSECS_PER_DAY) + (timeInput.value.getTime() % MSECS_PER_DAY));
const dt = new Date(dateInput.selectedDate.getFullYear(), dateInput.selectedDate.getMonth(), dateInput.selectedDate.getDate(), timeInput.value.getHours(), timeInput.value.getMinutes());
console.log(dt, dateInput.selectedDate, timeInput.value);
req.dateTime = dt;
req.maximumResults = 6;
......
Supports Markdown
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