Merge lp:~mihirsoni/ubuntu-calendar-app/1328203 into lp:ubuntu-calendar-app

Proposed by Mihir Soni
Status: Merged
Approved by: Kunal Parmar
Approved revision: 310
Merged at revision: 326
Proposed branch: lp:~mihirsoni/ubuntu-calendar-app/1328203
Merge into: lp:ubuntu-calendar-app
Diff against target: 48 lines (+9/-6)
1 file modified
NewEvent.qml (+9/-6)
To merge this branch: bzr merge lp:~mihirsoni/ubuntu-calendar-app/1328203
Reviewer Review Type Date Requested Status
Kunal Parmar Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+222534@code.launchpad.net

Commit message

Create an event with nearest time from day view or week view.

Description of the change

Create an event with nearest time from day view or week view.

To post a comment you must log in.
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
Kunal Parmar (pkunal-parmar) wrote :

I am getting this warning

file:///home/kunal/Dropbox/projects/qt/qml/ubuntu/calendar/review/1328203/NewEvent.qml:70: ReferenceError: startTime is not defined
file:///home/kunal/Dropbox/projects/qt/qml/ubuntu/calendar/review/1328203/NewEvent.qml:70: ReferenceError: startTime is not defined

otherwise code seems to work great

review: Needs Fixing
310. By Mihir Soni

removed warning

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
Kunal Parmar (pkunal-parmar) wrote :

looks good now

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NewEvent.qml'
2--- NewEvent.qml 2014-06-06 17:04:00 +0000
3+++ NewEvent.qml 2014-06-10 18:46:20 +0000
4@@ -11,7 +11,7 @@
5
6 Page {
7 id: root
8- property var date : new Date();
9+ property var date;
10
11 property var event:null;
12 property var model;
13@@ -34,10 +34,15 @@
14 }
15
16 Component.onCompleted: {
17+ //If current date is setted by an argument we don't have to change it.
18+ if(typeof(date) === 'undefined'){
19+ date = new Date();
20+ var newDate = new Date();
21+ date.setHours(newDate.getHours(), newDate.getMinutes());
22+ }
23+
24 // If startDate is setted by argument we have to not change it
25 //Set the nearest current time.
26- var newDate = new Date();
27- date.setHours(newDate.getHours(), newDate.getMinutes());
28 if (typeof(startDate) === 'undefined')
29 startDate = new Date(root.roundDate(date))
30
31@@ -45,6 +50,7 @@
32 if (typeof(endDate) === 'undefined') {
33 endDate = new Date(root.roundDate(date))
34 endDate.setMinutes(endDate.getMinutes() + 30)
35+ endTimeInput.text = Qt.formatDateTime(endDate, "hh:mm");
36 }
37
38 if(event === null){
39@@ -60,9 +66,6 @@
40 //Data for Add events
41 function addEvent() {
42 event = Qt.createQmlObject("import QtOrganizer 5.0; Event { }", Qt.application,"NewEvent.qml");
43-
44- startTime.text = Qt.formatDateTime(startDate, "dd MMM yyyy hh:mm");
45- endTime.text = Qt.formatDateTime(endDate, "dd MMM yyyy hh:mm");
46 }
47 //Editing Event
48 function editEvent(e) {

Subscribers

People subscribed via source and target branches

to status/vote changes: