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
0fa5b617
Commit
0fa5b617
authored
Oct 28, 2021
by
Claudio Cambra
Browse files
Date picker now correctly aligned in all locales
parent
f1123841
Pipeline
#91993
passed with stage
in 4 minutes and 49 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/monthmodel.cpp
View file @
0fa5b617
...
...
@@ -125,7 +125,7 @@ QVariant MonthModel::data(const QModelIndex &index, int role) const
if
(
!
index
.
parent
().
isValid
())
{
// Fetch days in month
int
prefix
=
d
->
calendar
.
dayOfWeek
(
QDate
(
d
->
year
,
d
->
month
,
1
))
-
1
;
int
prefix
=
d
->
calendar
.
dayOfWeek
(
QDate
(
d
->
year
,
d
->
month
,
1
))
-
m_locale
.
firstDayOfWeek
()
;
if
(
prefix
<=
1
)
{
prefix
+=
7
;
...
...
src/monthmodel.h
View file @
0fa5b617
...
...
@@ -6,6 +6,7 @@
#include
<QAbstractListModel>
#include
<QCalendar>
#include
<QDate>
#include
<QLocale>
#include
<memory>
/// Month model exposing month days and events to a QML view.
...
...
@@ -62,5 +63,6 @@ Q_SIGNALS:
private:
class
Private
;
QLocale
m_locale
;
std
::
unique_ptr
<
Private
>
d
;
};
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