Commit 69aff0ce authored by Claudio Cambra's avatar Claudio Cambra
Browse files

Fixed date misalignment issues in month grid

parent 5f63e05e
......@@ -66,12 +66,12 @@ void MonthViewModel::addDates(bool atEnd, QDate startFrom)
atEnd ? m_firstDayOfMonthDates[rowCount() - 1].addMonths(1) : m_firstDayOfMonthDates[0].addMonths(-1);
QDate startDate = firstDay;
if(startDate.dayOfWeek() == m_locale.firstDayOfWeek()) {
startDate = startDate.addDays(-7); // We want to slightly center the month in the grid
} else {
startDate = startDate.addDays(-startDate.dayOfWeek() + m_locale.firstDayOfWeek());
startDate = startDate.addDays(-startDate.dayOfWeek() + m_locale.firstDayOfWeek());
if (startDate >= firstDay) {
startDate = startDate.addDays(-7);
}
if(atEnd) {
m_firstDayOfMonthDates.append(firstDay);
m_startDates.append(startDate);
......
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