~renatofilho/ubuntu-calendar-app/majster-new-event-page

« back to all changes in this revision

Viewing changes to TimeLineBaseComponent.qml

  • Committer: Tarmac
  • Author(s): Kunal Parmar
  • Date: 2015-06-08 11:14:19 UTC
  • mfrom: (643.1.8 ubuntu-calendar-app)
  • Revision ID: tarmac-20150608111419-91vi9dgg1rbjx26n
WeekView highlight day before moving to day view.

Approved by Ubuntu Phone Apps Jenkins Bot, Alan Pope .

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
        var today = DateExt.today();
64
64
        var startOfWeek = today.weekStart(Qt.locale().firstDayOfWeek);
65
65
        var weekDay = today.getDay();
 
66
        var diff = weekDay - Qt.locale().firstDayOfWeek
 
67
        diff = diff < 0 ? 6 : diff
66
68
 
67
 
        if( startOfWeek.isSameDay(startDay) && weekDay > 2) {
68
 
            timeLineView.contentX = (weekDay * timeLineView.delegateWidth);            
 
69
        print(diff + ", " + Qt.locale().firstDayOfWeek + "--" + weekDay)
 
70
        if( startOfWeek.isSameDay(startDay) && diff > 2) {
 
71
            timeLineView.contentX = (diff * timeLineView.delegateWidth);
69
72
            if( timeLineView.contentX  > (timeLineView.contentWidth - timeLineView.width) ) {
70
73
                timeLineView.contentX = timeLineView.contentWidth - timeLineView.width
 
74
                print(timeLineView.contentX +"----" + (timeLineView.contentWidth - timeLineView.width) )
71
75
            }
72
76
        } else {
73
77
            timeLineView.contentX = 0;