Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Kalendar
Commits
95890f55
Verified
Commit
95890f55
authored
Oct 31, 2022
by
Claudio Cambra
Browse files
Fix final month dates in schedule view BUG:461200
Signed-off-by:
Claudio Cambra
<
claudio.cambra@kde.org
>
parent
b453fd64
Pipeline
#259064
passed with stage
in 2 minutes and 45 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/contents/ui/MainViews/BasicMonthListView.qml
View file @
95890f55
...
...
@@ -23,7 +23,7 @@ QQC2.ScrollView {
property
date
currentDate
:
new
Date
()
property
date
startDate
:
DateUtils
.
getFirstDayOfMonth
(
currentDate
)
readonly
property
int
daysInMonth
:
new
Date
(
startDate
.
getFullYear
(),
startDate
.
getMonth
(),
0
).
getDate
()
readonly
property
int
daysInMonth
:
new
Date
(
startDate
.
getFullYear
(),
startDate
.
getMonth
()
+
1
,
0
).
getDate
()
readonly
property
int
month
:
startDate
.
getMonth
()
readonly
property
int
year
:
startDate
.
getFullYear
()
...
...
@@ -179,11 +179,13 @@ QQC2.ScrollView {
Layout.bottomMargin
:
-
dayColumn
.
spacing
// Remove default spacing, bring week header right down to day square
text
:
{
let
nextDay
=
DateUtils
.
getLastDayOfWeek
(
DateUtils
.
nextWeek
(
periodStartDate
)
);
if
(
nextDay
.
getMonth
()
!==
periodStartDate
.
getMonth
())
{
nextDay
=
new
Date
(
nextDay
.
getFullYear
(),
nextDay
.
getMonth
(),
0
);
}
const
daysToWeekEnd
=
6
;
const
nextDayMaxDiff
=
(
periodStartDate
.
getDate
()
-
(
model
.
index
+
1
))
+
daysToWeekEnd
;
const
nextDayMaxDate
=
periodStartDate
.
getDate
()
+
nextDayMaxDiff
;
const
nextDayDate
=
Math
.
min
(
nextDayMaxDate
,
scrollView
.
daysInMonth
);
const
nextDay
=
new
Date
(
periodStartDate
.
getFullYear
(),
periodStartDate
.
getMonth
(),
nextDayDate
);
return
periodStartDate
.
toLocaleDateString
(
Qt
.
locale
(),
"
dddd <b>dd</b>
"
)
+
"
–
"
+
nextDay
.
toLocaleDateString
(
Qt
.
locale
(),
"
dddd <b>dd</b> MMMM
"
);
}
visible
:
Kalendar
.
Config
.
showWeekHeaders
&&
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment