diff --git a/calendar-client/src/customWidget/cweekwidget.cpp b/calendar-client/src/customWidget/cweekwidget.cpp index 8ce21a8c..5c3544d3 100644 --- a/calendar-client/src/customWidget/cweekwidget.cpp +++ b/calendar-client/src/customWidget/cweekwidget.cpp @@ -7,6 +7,7 @@ #include "constants.h" #include #include +#include CWeekWidget::CWeekWidget(QWidget *parent) : QPushButton(parent) , m_firstDay(CalendarManager::getInstance()->getFirstDayOfWeek()) @@ -69,7 +70,10 @@ void CWeekWidget::paintEvent(QPaintEvent *event) } QStringList weekStr; - weekStr << tr("Sun") << tr("Mon") << tr("Tue") << tr("Wed") << tr("Thu") << tr("Fri") << tr("Sat"); + for (int i = 1; i < 8; i++) { + QString weekDayName = locale.dayName(i, QLocale::NarrowFormat); + weekStr << weekDayName; + } //绘制周一到周日 for (int i = Qt::Monday; i <= Qt::Sunday; ++i) {