~renatofilho/ubuntu-calendar-app/optimize

« back to all changes in this revision

Viewing changes to calendar.qml

  • Committer: Renato Araujo Oliveira Filho
  • Date: 2016-02-25 18:56:52 UTC
  • Revision ID: renato.filho@canonical.com-20160225185652-jpxz0athht8svtom
Keep dates in sync btw panels.

Show diffs side-by-side

added added

removed removed

Lines of Context:
527
527
            model: eventModel.isReady ? eventModel : null
528
528
            bootomEdgeEnabled: tabs.selectedTabIndex === yearTab.index
529
529
 
 
530
            onCurrentYearChanged: {
 
531
                tabs.currentDay = new Date(currentYear, 1, 1)
 
532
            }
 
533
 
530
534
            onMonthSelected: {
531
535
                var now = DateExt.today();
532
536
                if ((date.getMonth() === now.getMonth()) &&
553
557
            model: eventModel.isReady ? eventModel : null
554
558
            bootomEdgeEnabled: tabs.selectedTabIndex === monthTab.index
555
559
 
 
560
            onCurrentDateChanged: {
 
561
                tabs.currentDay = currentDate
 
562
            }
 
563
 
556
564
            onHighlightedDateChanged: {
557
565
                if (highlightedDate)
558
566
                    tabs.currentDay = highlightedDate
567
575
 
568
576
            onActiveChanged: {
569
577
                if (active) {
570
 
                    anchorDate = tabs.currentDay.midnight()
 
578
                    anchorDate = new Date(tabs.currentDay.getFullYear(),
 
579
                                          tabs.currentDay.getMonth(),
 
580
                                          1,
 
581
                                          0, 0, 0)
571
582
                }
572
583
            }
573
584
        }
587
598
                    tabs.currentDay = currentDate
588
599
            }
589
600
 
 
601
            onCurrentDateChanged: {
 
602
                tabs.currentDay = currentDate.weekStart(Qt.locale().firstDayOfWeek)
 
603
            }
 
604
 
590
605
            onDateSelected: {
591
606
                tabs.currentDay = date;
592
607
                tabs.selectedTabIndex = dayTab.index
598
613
 
599
614
            onActiveChanged: {
600
615
                if (active) {
601
 
                    anchorDate = tabs.currentDay
 
616
                    anchorDate = tabs.currentDay.weekStart(Qt.locale().firstDayOfWeek)
602
617
                }
603
618
            }
604
619
        }
619
634
                bottomEdgeCommit(date, allDay)
620
635
            }
621
636
 
 
637
            onCurrentDateChanged: {
 
638
                tabs.currentDay = currentDate
 
639
            }
 
640
 
622
641
            onActiveChanged: {
623
642
                if (active) {
624
643
                    anchorDate = tabs.currentDay