thekingsimo / jquery-week-calendar

Automatically exported from code.google.com/p/jquery-week-calendar
0 stars 0 forks source link

Bug in Start/End Time dropdowns when scheduling SECOND event in Full Demo #116

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Great calendar!  I'm attempting to integrate it into a scheduling app.

There is a definite bug, though, which I caught the hard way after I put
the calendar into use on a production site.  Fortunately, the bug can be
replicated in your full demo (that's Demo 3 on your RedRedRed site).

Do this and you'll see the bug:
1. On your Demo 3, schedule a new event anywhere on the calendar.
2. Now, click to schedule a second event.
3. In the New Calendar Event dialog, click on either Start Time or End Time
and you'll see that there are far more start and end times than should be
included. Firebug indicates some of those times are for the days before and
after the calendar event being scheduled.

If this isn't clear, post a response and I'll try again.

--Bob

Original issue reported on code.google.com by rstein2...@gmail.com on 12 Jan 2010 at 11:13

GoogleCodeExporter commented 8 years ago
Okay, I found a solution to the issue.  The problem is with your resetForm 
function.

The resetForm() in the demo clears only the form fields, but you also need to 
REMOVE 
the selectbox options entirely with something like this:

$('#appointment_start').find('option').remove();

In that code, #appointment_start is the ID of your start times selectbox.  
You'd do 
the same with the end time selectbox.

The selectboxes have to be removed, because your setupStartAndEndTimeFields 
function 
APPENDS the selectbox options for the next appointment a user creates to 
whatever it 
finds.  So without the remove(), it'll just keep appending new times to the 
previous 
times.

Hope this helps.

--Bob

Original comment by rstein2...@gmail.com on 15 Jan 2010 at 11:25