~renatofilho/ubuntu-calendar-app/optimize

« back to all changes in this revision

Viewing changes to NewEvent.qml

  • Committer: Renato Araujo Oliveira Filho
  • Date: 2016-03-03 18:48:39 UTC
  • Revision ID: renato.filho@canonical.com-20160303184839-cvapteic26b2660d
Fix all day events edit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
126
126
        }
127
127
 
128
128
        startDate =new Date(e.startDateTime);
129
 
        endDate = new Date(e.endDateTime);
130
129
 
131
130
        if(e.displayLabel) {
132
131
            titleEdit.text = e.displayLabel;
133
132
        }
134
 
        if(e.allDay){
135
 
            allDayEventCheckbox.checked =true;
136
 
            endDate = endDate.addDays(-1);
 
133
 
 
134
        if (e.allDay) {
 
135
            allDayEventCheckbox.checked = true
 
136
            endDate = new Date(e.endDateTime).addDays(-1);
137
137
        }
138
138
 
139
139
        if(e.location) {
182
182
 
183
183
            event.allDay = allDayEventCheckbox.checked;
184
184
            if (event.allDay){
185
 
                event.startDateTime = startDate.midnight()
186
 
                event.endDateTime = startDate.addDays(1).midnight()
 
185
                event.startDateTime = new Date(startDate).midnight()
 
186
                event.endDateTime = new Date(endDate).addDays(1).midnight()
187
187
            } else {
188
188
                event.startDateTime = startDate;
189
189
                event.endDateTime = endDate;