diff --git a/applets/digital-clock/package/contents/ui/CalendarView.qml b/applets/digital-clock/package/contents/ui/CalendarView.qml --- a/applets/digital-clock/package/contents/ui/CalendarView.qml +++ b/applets/digital-clock/package/contents/ui/CalendarView.qml @@ -141,7 +141,7 @@ } level: 1 elide: Text.ElideRight - text: agenda.dateString("dddd") + text: uiLocale.standaloneDayName(monthView.currentDate.getDay()) } PlasmaComponents.Label { id: dateHeading @@ -152,7 +152,7 @@ leftMargin: spacing / 2 } elide: Text.ElideRight - text: Qt.locale().standaloneMonthName(monthView.currentDate.getMonth()) + text: uiLocale.standaloneMonthName(monthView.currentDate.getMonth()) + agenda.dateString(" yyyy") } diff --git a/applets/digital-clock/package/contents/ui/DigitalClock.qml b/applets/digital-clock/package/contents/ui/DigitalClock.qml --- a/applets/digital-clock/package/contents/ui/DigitalClock.qml +++ b/applets/digital-clock/package/contents/ui/DigitalClock.qml @@ -594,7 +594,11 @@ if (main.showDate) { - dateLabel.text = Qt.formatDate(main.currentTime, main.dateFormat); + if (main.dateFormat == Qt.SystemLocaleLongDate) { + dateLabel.text = uiLocaleFormatDate(main.currentTime, Qt.locale().dateFormat(Locale.LongFormat)); + } else { + dateLabel.text = Qt.formatDate(main.currentTime, main.dateFormat); + } } else { // clear it so it doesn't take space in the layout dateLabel.text = ""; diff --git a/applets/digital-clock/package/contents/ui/Tooltip.qml b/applets/digital-clock/package/contents/ui/Tooltip.qml --- a/applets/digital-clock/package/contents/ui/Tooltip.qml +++ b/applets/digital-clock/package/contents/ui/Tooltip.qml @@ -92,14 +92,14 @@ Layout.minimumWidth: Math.min(implicitWidth, preferredTextWidth) Layout.maximumWidth: preferredTextWidth elide: Text.ElideRight - text: Qt.formatDate(tzDate,"dddd") + text: uiLocale.standaloneDayName(tzDate.getDay()) } PlasmaComponents.Label { id: tooltipSubtext Layout.minimumWidth: Math.min(implicitWidth, preferredTextWidth) Layout.maximumWidth: preferredTextWidth - text: Qt.formatDate(tzDate, dateFormatString) + text: uiLocaleFormatDate(tzDate, dateFormatString) opacity: 0.6 } diff --git a/applets/digital-clock/package/contents/ui/main.qml b/applets/digital-clock/package/contents/ui/main.qml --- a/applets/digital-clock/package/contents/ui/main.qml +++ b/applets/digital-clock/package/contents/ui/main.qml @@ -31,6 +31,7 @@ width: units.gridUnit * 10 height: units.gridUnit * 4 + property var uiLocale: Qt.locale(Qt.locale().uiLanguages[0]) property string dateFormatString: setDateFormatString() property date tzDate: { // get the time for the given timezone from the dataengine @@ -90,6 +91,12 @@ return format; } + function uiLocaleFormatDate(date, format) { + format = format.replace("dddd", "'" + uiLocale.dayName(date.getDay()) + "'") + .replace("MMMM", "'" + uiLocale.monthName(date.getMonth()) + "'"); + return Qt.formatDate(date, format); + } + function action_clockkcm() { KCMShell.open("clock"); }