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
d0a042fd
Commit
d0a042fd
authored
Nov 23, 2021
by
Claudio Cambra
Browse files
Fixed prior month numbers when viewing January, fixes
#94
parent
dc7ec4b0
Pipeline
#100372
passed with stage
in 5 minutes and 9 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/monthmodel.cpp
View file @
d0a042fd
...
...
@@ -3,6 +3,7 @@
#include
"monthmodel.h"
#include
<QDate>
#include
<QDebug>
#include
<QRandomGenerator>
struct
MonthModel
::
Private
{
...
...
@@ -153,8 +154,8 @@ QVariant MonthModel::data(const QModelIndex &index, int role) const
day
=
row
-
daysInMonth
-
prefix
+
1
;
}
else
{
// Previous month
year
=
d
->
month
>
0
?
d
->
year
:
d
->
year
-
1
;
month
=
d
->
month
>
0
?
d
->
month
-
1
:
d
->
calendar
.
monthsInYear
(
year
)
-
1
;
year
=
d
->
month
>
1
?
d
->
year
:
d
->
year
-
1
;
month
=
d
->
month
>
1
?
d
->
month
-
1
:
d
->
calendar
.
monthsInYear
(
year
);
int
daysInPreviousMonth
=
d
->
calendar
.
daysInMonth
(
month
,
year
);
day
=
daysInPreviousMonth
-
prefix
+
row
+
1
;
}
...
...
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