~pkunal-parmar/ubuntu-calendar-app/RecurranceField

« back to all changes in this revision

Viewing changes to DayView.qml

  • Committer: Kunal Parmar
  • Date: 2013-09-03 23:46:17 UTC
  • mfrom: (106 trunk)
  • mto: This revision was merged to the branch mainline in revision 108.
  • Revision ID: pkunal.parmar@gmail.com-20130903234617-jvsxsf9whrl0m6mx
Trunk code merged

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
    property var currentDay: new Date()
14
14
 
15
15
    onCurrentDayChanged:{
16
 
        weekRibbon.visibleWeek = currentDay.weekStart(intern.firstDayOfWeek);
 
16
        weekRibbon.visibleWeek = currentDay.weekStart(Qt.locale().firstDayOfWeek);
17
17
        weekRibbon.setSelectedDay(currentDay);
18
18
    }
19
19
 
29
29
        text: new Date(0, 0, 0, 0).toLocaleTimeString(Qt.locale(), i18n.tr("HH"))
30
30
    }
31
31
 
32
 
    Label{
33
 
        id: dummy;text: "SUN";visible: false;fontSize: "large"
34
 
    }
35
 
 
36
32
    WeekRibbon{
37
33
        id: weekRibbon
38
 
        visibleWeek: currentDay.weekStart(intern.firstDayOfWeek);
 
34
        visibleWeek: currentDay.weekStart(Qt.locale().firstDayOfWeek);
39
35
        anchors.top: todayLabel.bottom
40
36
        anchors.left: timeLabel.right
41
 
        width: parent.width - timeLabel.width
 
37
        width: parent.width
42
38
        height: units.gu(10)
43
 
        weekWidth: dummy.width + units.gu(1)
 
39
        //removing timeLabel.width from front and back of ribbon
 
40
        weekWidth: ((width - 2* timeLabel.width )/ 7 )
44
41
 
45
42
        onWeekChanged: {
46
43
            currentDay = visibleWeek
59
56
 
60
57
        QtObject{
61
58
            id: intern
62
 
            property int firstDayOfWeek: Qt.locale().firstDayOfWeek
63
59
            property var startDay: weekViewPath.visibleDay.addDays(-1)
64
60
        }
65
61
 
89
85
 
90
86
            width: parent.width
91
87
            height: parent.height
92
 
            weekWidth: dummy.width + units.gu(1)
 
88
            weekWidth: weekRibbon.weekWidth
93
89
            day: getStartDay();
94
90
 
95
91
            function getStartDay() {