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

« back to all changes in this revision

Viewing changes to calendar.qml

  • Committer: Tarmac
  • Author(s): Kunal Parmar
  • Date: 2013-10-14 13:57:42 UTC
  • mfrom: (124.3.10 ubuntu-calendar-app)
  • Revision ID: tarmac-20131014135742-xatlilnykrxfy2as
DataModel moved to use QtOrganizer,
Organizer uses EDS as data source,
Related changes required to use QtOrganizer
.

Approved by David Planella, Ubuntu Phone Apps Jenkins Bot, Renato Araujo Oliveira Filho.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
import Ubuntu.Components.Popups 0.1
4
4
 
5
5
import "dateExt.js" as DateExt
 
6
import "GlobalEventModel.js" as GlobalModel
6
7
 
7
8
MainView {
8
9
    id: mainView
27
28
            id: tabPage
28
29
 
29
30
            property var currentDay: DateExt.today();
 
31
            property var globalModel;
30
32
 
31
33
            onCurrentDayChanged: {
32
34
                if( monthView.currentMonth !== undefined && !monthView.currentMonth.isSameDay(currentDay))
37
39
 
38
40
                if( !weekView.dayStart.isSameDay(currentDay))
39
41
                    weekView.dayStart = currentDay
 
42
 
 
43
                setStartEndDateToModel();
 
44
            }
 
45
 
 
46
            function setStartEndDateToModel() {
 
47
                if(globalModel) {
 
48
                    globalModel.startPeriod =  new Date(currentDay.getFullYear(),0,1,0,0,0,0);
 
49
                    globalModel.endPeriod = new Date(currentDay.getFullYear(),11,31,0,0,0,0);
 
50
                }
40
51
            }
41
52
 
42
53
            function newEvent() {
44
55
            }
45
56
 
46
57
            Component.onCompleted: {
47
 
                tabs.selectedTabIndex= 1;
 
58
                globalModel = GlobalModel.gloablModel();
 
59
                setStartEndDateToModel();
 
60
                tabs.selectedTabIndex = 1;
48
61
            }
49
62
 
50
63
            ToolbarItems {