~ubuntu-clock-dev/ubuntu-clock-app/reboot-packaging

« back to all changes in this revision

Viewing changes to app/clock/MainClock.qml

  • Committer: Nekhelesh Ramananthan
  • Date: 2014-07-26 09:34:15 UTC
  • mto: (37.1.1 reboot)
  • mto: This revision was merged to the branch mainline in revision 37.
  • Revision ID: krnekhelesh@gmail.com-20140726093415-67r3x357o0fnq08n
Initial working version

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 */
18
18
 
19
19
import QtQuick 2.0
 
20
import DateTime 1.0
20
21
import Ubuntu.Components 1.1
21
22
import "../components"
22
23
 
29
30
 
30
31
    isMainClock: true
31
32
 
 
33
    DateTime {
 
34
        id: localTimeSource
 
35
    }
 
36
 
 
37
    /*
 
38
     Create a new Date() object and pass the date, month, year, hour, minute
 
39
     and second received from the DateTime plugin manually to ensure the
 
40
     timezone info is set correctly.
 
41
 
 
42
     Javascript Month is 0-12 while QDateTime month is 1-12. Hence the -1
 
43
     is required.
 
44
    */
 
45
    analogTime: new Date
 
46
                (
 
47
                    localTimeSource.localDateString.split(":")[0],
 
48
                    localTimeSource.localDateString.split(":")[1]-1,
 
49
                    localTimeSource.localDateString.split(":")[2],
 
50
                    localTimeSource.localTimeString.split(":")[0],
 
51
                    localTimeSource.localTimeString.split(":")[1],
 
52
                    localTimeSource.localTimeString.split(":")[2],
 
53
                    0
 
54
                )
 
55
    time: Qt.formatTime(analogTime)
 
56
 
32
57
    isDigital: clockModeDocument.contents.digitalMode ? true : false
33
58
 
34
59
    Component.onCompleted: {