Skip to content

Commit 18ef378

Browse files
MyLeeJiEundeepin-bot[bot]
authored andcommitted
fix: correct relative time format for yesterday
1. Use UDAT_ABSOLUTE_DAY instead of UDAT_DIRECTION_LAST + UDAT_RELATIVE_DAYS 2. Remove the redundant numeric argument that was passed to formatter->format() 3. Ensure the ICU API call matches the correct overload for absolute day formatting Log: Fix yesterday's relative time formatting by using correct ICU API arguments fix: 修复"昨天"相对时间格式错误 1. 使用 UDAT_ABSOLUTE_DAY 替换 UDAT_DIRECTION_LAST + UDAT_RELATIVE_DAYS 2. 移除传递给 formatter->format() 的多余数值参数 3. 确保 ICU API 调用匹配绝对日期格式的正确重载 Log: 修复昨天相对时间格式化问题,使用正确的 ICU API 参数 PMS: BUG-359117
1 parent 66d5690 commit 18ef378

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

panels/notification/common/notifyentity.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ QString NotifyEntity::formatRelativeTime(qint64 ctimeMs)
405405
return toQString(result);
406406
}
407407
} else if (elapsedDay >= 1 && elapsedDay < 2) {
408-
formatter->format(1, UDAT_DIRECTION_LAST, UDAT_RELATIVE_DAYS, result, status);
408+
formatter->format(UDAT_DIRECTION_LAST, UDAT_ABSOLUTE_DAY, result, status);
409409
UnicodeString combinedString;
410410
UErrorCode timeStatus = U_ZERO_ERROR;
411411
SimpleDateFormat timeFormatter("HH:mm", icu::Locale::getDefault(), timeStatus);

0 commit comments

Comments
 (0)