Changeset View
Changeset View
Standalone View
Standalone View
applets/digital-clock/package/contents/ui/main.qml
Show All 26 Lines | |||||
27 | import org.kde.plasma.calendar 2.0 as PlasmaCalendar | 27 | import org.kde.plasma.calendar 2.0 as PlasmaCalendar | ||
28 | 28 | | |||
29 | Item { | 29 | Item { | ||
30 | id: root | 30 | id: root | ||
31 | 31 | | |||
32 | width: units.gridUnit * 10 | 32 | width: units.gridUnit * 10 | ||
33 | height: units.gridUnit * 4 | 33 | height: units.gridUnit * 4 | ||
34 | property string dateFormatString: setDateFormatString() | 34 | property string dateFormatString: setDateFormatString() | ||
35 | Plasmoid.backgroundHints: PlasmaCore.Types.ShadowBackground | PlasmaCore.Types.ConfigurableBackground | ||||
35 | property date tzDate: { | 36 | property date tzDate: { | ||
36 | // get the time for the given timezone from the dataengine | 37 | // get the time for the given timezone from the dataengine | ||
37 | var now = dataSource.data[plasmoid.configuration.lastSelectedTimezone]["DateTime"]; | 38 | var now = dataSource.data[plasmoid.configuration.lastSelectedTimezone]["DateTime"]; | ||
38 | // get current UTC time | 39 | // get current UTC time | ||
39 | var msUTC = now.getTime() + (now.getTimezoneOffset() * 60000); | 40 | var msUTC = now.getTime() + (now.getTimezoneOffset() * 60000); | ||
40 | // add the dataengine TZ offset to it | 41 | // add the dataengine TZ offset to it | ||
41 | return new Date(msUTC + (dataSource.data[plasmoid.configuration.lastSelectedTimezone]["Offset"] * 1000)); | 42 | return new Date(msUTC + (dataSource.data[plasmoid.configuration.lastSelectedTimezone]["Offset"] * 1000)); | ||
42 | } | 43 | } | ||
▲ Show 20 Lines • Show All 75 Lines • Show Last 20 Lines |