Commit 0fa5b617 authored by Claudio Cambra's avatar 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
......@@ -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;
......
......@@ -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;
};
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