Merge lp:~vthompson/ubuntu-calendar-app/fix-1311159-1311133 into lp:ubuntu-calendar-app

Proposed by Victor Thompson
Status: Merged
Approved by: Mihir Soni
Approved revision: 257
Merged at revision: 257
Proposed branch: lp:~vthompson/ubuntu-calendar-app/fix-1311159-1311133
Merge into: lp:ubuntu-calendar-app
Diff against target: 87 lines (+14/-21)
1 file modified
NewEvent.qml (+14/-21)
To merge this branch: bzr merge lp:~vthompson/ubuntu-calendar-app/fix-1311159-1311133
Reviewer Review Type Date Requested Status
Mihir Soni Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+217159@code.launchpad.net

Commit message

* Use date rounded up to nearest half hour
* Set TimePicker to the value in the field

Description of the change

* Use date rounded up to nearest half hour
* Set TimePicker to the value in the field

To post a comment you must log in.
Revision history for this message
Victor Thompson (vthompson) wrote :

Currently I'm unable to directly verify this fix because of lp:1312480. I can't get trunk to run on the desktop either, at the moment.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Mihir Soni (mihirsoni) wrote :

Looks good to me , i have tested it on desktop.

review: Approve
Revision history for this message
Victor Thompson (vthompson) wrote :

Now that I can run on the device (adding the fix for lp:1312480), it seems it doesn't work on my Nexus 4. I'll investigate.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
257. By Victor Thompson

Merge trunk

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Victor Thompson (vthompson) wrote :

This should be working now on both the desktop and the device.

Revision history for this message
Mihir Soni (mihirsoni) wrote :

Looks good to me Thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'NewEvent.qml'
--- NewEvent.qml 2014-04-25 00:17:55 +0000
+++ NewEvent.qml 2014-04-27 19:52:25 +0000
@@ -10,7 +10,7 @@
1010
11Page {11Page {
12 id: root12 id: root
13 property var date: new Date();13 property var date;
1414
15 property var event:null;15 property var event:null;
16 property var model;16 property var model;
@@ -24,16 +24,17 @@
2424
25 Component.onCompleted: {25 Component.onCompleted: {
2626
27 date = new Date()
27 pageStack.header.visible = true;28 pageStack.header.visible = true;
2829
29 // If startDate is setted by argument we have to not change it30 // If startDate is setted by argument we have to not change it
30 if (typeof(startDate) === 'undefined')31 if (typeof(startDate) === 'undefined')
31 startDate = new Date(date)32 startDate = new Date(root.roundDate(date))
3233
33 // If endDate is setted by argument we have to not change it34 // If endDate is setted by argument we have to not change it
34 if (typeof(endDate) === 'undefined') {35 if (typeof(endDate) === 'undefined') {
35 endDate = new Date(date)36 endDate = new Date(root.roundDate(date))
36 endDate.setMinutes( endDate.getMinutes() + 30)37 endDate.setMinutes(endDate.getMinutes() + 30)
37 }38 }
3839
39 if(event === null){40 if(event === null){
@@ -49,9 +50,6 @@
49 //Data for Add events50 //Data for Add events
50 function addEvent() {51 function addEvent() {
51 event = Qt.createQmlObject("import QtOrganizer 5.0; Event { }", Qt.application,"NewEvent.qml");52 event = Qt.createQmlObject("import QtOrganizer 5.0; Event { }", Qt.application,"NewEvent.qml");
52 startDate = new Date(date)
53 endDate = new Date(date)
54 endDate.setMinutes( endDate.getMinutes() + 30)
5553
56 startTime.text = Qt.formatDateTime(startDate, "dd MMM yyyy hh:mm");54 startTime.text = Qt.formatDateTime(startDate, "dd MMM yyyy hh:mm");
57 endTime.text = Qt.formatDateTime(endDate, "dd MMM yyyy hh:mm");55 endTime.text = Qt.formatDateTime(endDate, "dd MMM yyyy hh:mm");
@@ -158,18 +156,13 @@
158 }156 }
159 }157 }
160158
161 // Calucate default hour for start and end time on event159 // Calucate default hour and minute for start and end time on event
162 function hourForPickerFromDate(date) {160 function roundDate(date) {
163 if(date.getMinutes() < 30)161 var tempDate = new Date(date)
164 return date.getHours()162 if(tempDate.getMinutes() < 30)
165 return date.getHours() + 1163 return tempDate.setMinutes(30)
166 }164 tempDate.setMinutes(0)
167165 return tempDate.setHours(tempDate.getHours() + 1)
168 // Calucate default minute for start and end time on event
169 function minuteForPickerFromDate(date) {
170 if(date.getMinutes() < 30)
171 return 30
172 return 0
173 }166 }
174167
175 width: parent.width168 width: parent.width
@@ -286,7 +279,7 @@
286 anchors.fill: parent279 anchors.fill: parent
287 onClicked: {280 onClicked: {
288 internal.clearFocus()281 internal.clearFocus()
289 var popupObj = PopupUtils.open(timePicker,root,{"hour": root.hourForPickerFromDate(startDate),"minute":root.minuteForPickerFromDate(startDate)});282 var popupObj = PopupUtils.open(timePicker,root,{"hour": startDate.getHours(),"minute":startDate.getMinutes()});
290 popupObj.accepted.connect(function(startHour, startMinute) {283 popupObj.accepted.connect(function(startHour, startMinute) {
291 var newDate = startDate;284 var newDate = startDate;
292 newDate.setHours(startHour, startMinute);285 newDate.setHours(startHour, startMinute);
@@ -311,7 +304,7 @@
311 anchors.fill: parent304 anchors.fill: parent
312 onClicked: {305 onClicked: {
313 internal.clearFocus()306 internal.clearFocus()
314 var popupObj = PopupUtils.open(timePicker,root,{"hour": root.hourForPickerFromDate(endDate),"minute":root.minuteForPickerFromDate(endDate)});307 var popupObj = PopupUtils.open(timePicker,root,{"hour": endDate.getHours(),"minute":endDate.getMinutes()});
315 popupObj.accepted.connect(function(startHour, startMinute) {308 popupObj.accepted.connect(function(startHour, startMinute) {
316 var newDate = endDate;309 var newDate = endDate;
317 newDate.setHours(startHour, startMinute);310 newDate.setHours(startHour, startMinute);

Subscribers

People subscribed via source and target branches

to status/vote changes: