Changeset View
Changeset View
Standalone View
Standalone View
applets/analog-clock/contents/ui/analogclock.qml
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Line(s) | 30 | Item { | |||
---|---|---|---|---|---|
45 | Plasmoid.toolTipMainText: Qt.formatDate(dataSource.data["Local"]["DateTime"],"dddd") | 45 | Plasmoid.toolTipMainText: Qt.formatDate(dataSource.data["Local"]["DateTime"],"dddd") | ||
46 | Plasmoid.toolTipSubText: Qt.formatDate(dataSource.data["Local"]["DateTime"], Qt.locale().dateFormat(Locale.LongFormat).replace(/(^dddd.?\s)|(,?\sdddd$)/, "")) | 46 | Plasmoid.toolTipSubText: Qt.formatDate(dataSource.data["Local"]["DateTime"], Qt.locale().dateFormat(Locale.LongFormat).replace(/(^dddd.?\s)|(,?\sdddd$)/, "")) | ||
47 | 47 | | |||
48 | PlasmaCore.DataSource { | 48 | PlasmaCore.DataSource { | ||
49 | id: dataSource | 49 | id: dataSource | ||
50 | engine: "time" | 50 | engine: "time" | ||
51 | connectedSources: "Local" | 51 | connectedSources: "Local" | ||
52 | interval: showSecondsHand ? 1000 : 30000 | 52 | interval: showSecondsHand ? 1000 : 30000 | ||
53 | onDataChanged: { | 53 | function onDataChanged() { | ||
54 | var date = new Date(data["Local"]["DateTime"]); | 54 | var date = new Date(data["Local"]["DateTime"]); | ||
55 | hours = date.getHours(); | 55 | hours = date.getHours(); | ||
56 | minutes = date.getMinutes(); | 56 | minutes = date.getMinutes(); | ||
57 | seconds = date.getSeconds(); | 57 | seconds = date.getSeconds(); | ||
58 | } | 58 | } | ||
59 | Component.onCompleted: { | 59 | Component.onCompleted: { | ||
60 | onDataChanged(); | 60 | onDataChanged(); | ||
61 | } | 61 | } | ||
▲ Show 20 Lines • Show All 180 Lines • Show Last 20 Lines |