Commit 567b4263 authored by Claudio Cambra's avatar Claudio Cambra
Browse files

Fixed 'Today' button in the hourly views. Fixes #132

parent fccdb16a
Pipeline #107261 passed with stage
in 6 minutes and 27 seconds
......@@ -69,7 +69,7 @@ Kirigami.Page {
if(root.daysToShow % 7 === 0) {
date = DateUtils.getFirstDayOfWeek(date);
}
const weekDiff = Math.round((date.getTime() - pathView.currentItem.startDate.getTime()) / (root.daysToShow * 24 * 60 * 60 * 1000));
const weekDiff = Math.floor((date.getTime() - pathView.currentItem.startDate.getTime()) / (root.daysToShow * 24 * 60 * 60 * 1000));
let position = pathView.currentItem.item.hourScrollView.getCurrentPosition();
let newIndex = pathView.currentIndex + weekDiff;
......@@ -116,7 +116,7 @@ Kirigami.Page {
}
readonly property Kirigami.Action todayAction: Kirigami.Action {
icon.name: "go-jump-today"
text: i18n("Today")
text: i18n("Now")
onTriggered: setToDate(new Date(), true);
}
......
......@@ -989,9 +989,9 @@ Kirigami.ApplicationWindow {
}
function openDayLayer(selectedDate) {
if(!isNaN(selectedDate.getTime())) {
dayScaleModelLoader.active = true;
dayScaleModelLoader.active = true;
if(!isNaN(selectedDate.getTime())) {
root.selectedDate = selectedDate;
if(Kirigami.Settings.isMobile) {
......@@ -1008,7 +1008,7 @@ Kirigami.ApplicationWindow {
view.QQC2.StackView.removed.connect(function () { pageStack.currentItem.header = filterHeader.item; });
}
pageStack.layers.currentItem.setToDate(root.selectedDate, true);
view.setToDate(root.selectedDate, true);
}
}
}
......
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