Closed Bug 432998 Opened 12 years ago Closed 12 years ago

Creating event ignores selected date and creates event for today

Categories

(Calendar :: Calendar Views, defect)

defect
Not set

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: mozilla, Assigned: Fallen)

References

Details

(Keywords: regression)

Attachments

(1 file, 2 obsolete files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14
Build Identifier: Lightning 0.9pre 2008-05-08 20 / Thunderbird 2.0.0.14

Event dialog ignores double-clicked day when create new event.

Reproducible: Always

Steps to Reproduce:
1) In month view, double click a day in the future to create a new event.

Actual Results:  
The Start date in the event dialog is always today.

Expected Results:  
The Start date should be the same as the day on which I double clicked.
Regression range: Works in Sunbird 0.9pre (2008-05-06-18)
                  Fails in Sunbird 0.9pre (2008-05-07-12)

Checkins during regression range: http://tinyurl.com/6y57uv

Probably regressed by Bug 428715.
Status: UNCONFIRMED → NEW
Component: General → Calendar Views
Ever confirmed: true
Keywords: regression
QA Contact: general → views
My bug, again. I'll be taking care.
Assignee: nobody → philipp
Attached patch Fix - v1 (obsolete) — Splinter Review
This bug fixes the regression, and also fixes bug 390020. Note this patch might cause further regressions, please review carefully (not due to the fact that I'm including a fix to bug 390020!):

-        } else if (aStartTime && aStartTime.isDate) {
-            var event = createEvent();
-            event.startDate = aStartTime;
-            setDefaultAlarmValues(event);
-            doTransaction('add', event, aCalendar, null, null);
         } else {

I looked through the code and could fine nothing that would trigger such a case. The only place that createNewEvent was being called was when dragging in the "new" mode and when doubleclicking. It didn't look like this piece of code would ever be hit. I needed to remove that to make sure that its possible to pass all-day start dates, to either force it to be an allday event or to fit the hour to an existing date. The doubleclicking is passed quite controlled, so the only place I can imagine this is needed would be during dragging.
Attachment #320464 - Flags: review?(mschroeder)
Blocks: 390020
Status: NEW → ASSIGNED
OS: Windows XP → All
Hardware: PC → All
Regression also applies for events created via menu entry, toolbar button, keyboard shortcut and context menu. 
Summary: Event dialog ignores double-clicked day when create new event → Creating event ignores selected date and creates event for today
Comment on attachment 320464 [details] [diff] [review]
Fix - v1

Like Stefan mentioned, when creating a new event via menu entry, toolbar button, keyboard shortcut and context menu this doesn't work. Also with the patch applied today's date is picked for these ways to create an event, but the views work nicely again.

r-
Attachment #320464 - Flags: review?(mschroeder) → review-
Attached patch Fix - v2 (obsolete) — Splinter Review
This patch should take care. I wasn't aware we were using the selected day.
Attachment #320464 - Attachment is obsolete: true
Attachment #321369 - Flags: review?(mschroeder)
Attached patch Fix - v3Splinter Review
It seems a chunk was missing, here it is.
Attachment #321369 - Attachment is obsolete: true
Attachment #321994 - Flags: review?(mschroeder)
Attachment #321369 - Flags: review?(mschroeder)
Comment on attachment 321994 [details] [diff] [review]
Fix - v3

r=mschroeder
Attachment #321994 - Flags: review?(mschroeder) → review+
Checked in on HEAD and MOZILLA_1_8_BRANCH (as requested from Philipp)

-> FIXED
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → 0.9
Verified using Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.15pre) Gecko/2008052220 Calendar/0.9pre.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.