← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~renatofilho/ubuntu-calendar-app/fix-url-arg into lp:ubuntu-calendar-app

 

Renato Araujo Oliveira Filho has proposed merging lp:~renatofilho/ubuntu-calendar-app/fix-url-arg into lp:ubuntu-calendar-app.

Commit message:
Show correct date and time when url handler is invoked with the app open.

Requested reviews:
  Ubuntu Calendar Developers (ubuntu-calendar-dev)

For more details, see:
https://code.launchpad.net/~renatofilho/ubuntu-calendar-app/fix-url-arg/+merge/289885
-- 
Your team Ubuntu Calendar Developers is requested to review the proposed merge of lp:~renatofilho/ubuntu-calendar-app/fix-url-arg into lp:ubuntu-calendar-app.
=== modified file 'calendar.qml'
--- calendar.qml	2016-03-22 20:28:17 +0000
+++ calendar.qml	2016-03-23 12:00:03 +0000
@@ -126,7 +126,11 @@
             handleUri(uris[0])
             if (tabs.starttime !== -1) {
                 tabs.currentDay = new Date(tabs.starttime);
-                tabs.selectedTabIndex = dayTab.index
+                if (tabs.selectedTabIndex != dayTab.index)
+                    tabs.selectedTabIndex = dayTab.index
+                else {
+                    dayTab.page.item.showDate(tabs.currentDay)
+                }
                 tabs.starttime = -1
             }
         }
@@ -735,10 +739,10 @@
             function showDate(date)
             {
                 var dateGoTo = new Date(date)
-                if (!anchorDate ||
-                    (dateGoTo.getFullYear() != anchorDate.getFullYear()) ||
-                    (dateGoTo.getMonth() != anchorDate.getMonth()) ||
-                    (dateGoTo.getDate() != anchorDate.getDate())) {
+                if (!currentDate ||
+                    (dateGoTo.getFullYear() !== currentDate.getFullYear()) ||
+                    (dateGoTo.getMonth() !== currentDate.getMonth()) ||
+                    (dateGoTo.getDate() !== currentDate.getDate())) {
                     anchorDate = new Date(dateGoTo)
                 }
                 delayScrollToDate(dateGoTo)


References