mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 09:23:03 +00:00
fix: 日期和星期之间未加空格
日期和星期之间添加空格 Log: 修复日期和星期之间未加空格的问题 Influence: 任务栏日期tips Bug: https://pms.uniontech.com/task-view-169401.html Change-Id: I3a1ba43b0008541b94b3769f6d67f60501c2b022
This commit is contained in:
parent
57536dbc15
commit
11abb21320
@ -275,7 +275,7 @@ void DatetimeWidget::updateDateTimeString()
|
||||
updateWeekdayFormat();
|
||||
|
||||
switch (m_longDateFormatType) {
|
||||
case 0 :
|
||||
case 0:
|
||||
m_dateTime = longTimeFormat + currentDateTime.toString(m_longTimeFormat);
|
||||
break;
|
||||
case 1:
|
||||
@ -288,14 +288,14 @@ void DatetimeWidget::updateDateTimeString()
|
||||
m_dateTime = longTimeFormat + QString(" ") + m_weekFormat + currentDateTime.toString(m_longTimeFormat);
|
||||
break;
|
||||
}
|
||||
} else if (lang == QLocale::English){
|
||||
} else if (lang == QLocale::English) {
|
||||
auto longDateString = currentDateTime.date().toString(Qt::SystemLocaleLongDate);
|
||||
auto week = longDateString.split(",").at(0);
|
||||
// 获取英文的日期格式字符串,-2是去掉","和" "
|
||||
auto longDateTimeFormat = longDateString.right(longDateString.size() - week.size() -2);
|
||||
auto longDateTimeFormat = longDateString.right(longDateString.size() - week.size() - 2);
|
||||
|
||||
switch (m_longDateFormatType) {
|
||||
case 0 :
|
||||
case 0:
|
||||
m_dateTime = longDateTimeFormat + currentDateTime.toString(m_longTimeFormat);
|
||||
break;
|
||||
case 1:
|
||||
@ -305,10 +305,10 @@ void DatetimeWidget::updateDateTimeString()
|
||||
m_dateTime = week + QString(", ") + longDateTimeFormat + currentDateTime.toString(m_longTimeFormat);
|
||||
break;
|
||||
default:
|
||||
m_dateTime = longDateTimeFormat + QString(",") + week + currentDateTime.toString(m_longTimeFormat);
|
||||
m_dateTime = longDateTimeFormat + QString(", ") + week + currentDateTime.toString(m_longTimeFormat);
|
||||
break;
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
m_dateTime = currentDateTime.date().toString(Qt::SystemLocaleLongDate) + currentDateTime.toString(m_longTimeFormat);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user