~mihirsoni/ubuntu-calendar-app/dateSelectNewEventTest

« back to all changes in this revision

Viewing changes to DiaryView.qml

  • Committer: Frank Mertens
  • Date: 2013-03-19 23:42:36 UTC
  • mto: This revision was merged to the branch mainline in revision 11.
  • Revision ID: frank@cyblogic.de-20130319234236-p5tcchd8harzcfwa
Added the EventListModel to support the display of event lists.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
import QtQuick 2.0
2
2
import Ubuntu.Components 0.1
 
3
import "dateExt.js" as DateExt
3
4
 
4
5
Rectangle {
5
 
    property var dayStart: {
6
 
        if (index == intern.currentIndex) return intern.currentDayStart
7
 
        var previousIndex = intern.currentIndex > 0 ? intern.currentIndex - 1 : 2
8
 
        if (index == previousIndex) return intern.currentDayStart.addDays(-1)
9
 
        return intern.currentDayStart.addDays(1)
10
 
    }
11
 
    width: eventView.width
12
 
    height: eventView.height
 
6
    property var dayStart: new Date()
 
7
 
13
8
    color: index == 0 ? "#FFFFFF" : index == 1 ? "#EEEEEE" : "#DDDDDD"
14
9
 
15
 
    EventsModel {}
 
10
    EventListModel {
 
11
        termStart: dayStart
 
12
    }
16
13
 
17
14
    Label {
18
15
        anchors.horizontalCenter: parent.horizontalCenter