prince501 / jquery-events-calendar

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

Current date has event but needs to be clicked again #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Add event to JSON object with today's date
2. Open in Google Chrome
3. "There are no events in this period"
4. Click on the day, and the event shows up.

What is the expected output? What do you see instead?
The day's events should show up on a page load / refresh

What version of the product are you using? On what operating system?
0.42

Please provide any additional information below.

Original issue reported on code.google.com by Geoffrey...@gmail.com on 20 Feb 2013 at 4:43

Attachments:

GoogleCodeExporter commented 9 years ago
Same issue here, can't seem to find a fix

Original comment by Stoke...@gmail.com on 5 Dec 2013 at 4:26

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Here's a fix, replace line 359 down @ jquery.eventCalendar.js

                    if (limit === 0 || limit > i) {
                        // if month or day exist then only show matched events

                        if ((month === false) && (day == '') && (year == '')) {
                            // if no month, day, or year is selected aka initial load do this

                                var actualDate = new Date();
                                var actualDay = actualDate.getDate();
                                var actualMonth = actualDate.getMonth();

                                if ((eventMonth === actualMonth && eventDay === actualDay)) {
                                    // show today's events on initial load

                                // if ((eventMonth === actualMonth && eventDay > actualDay)) {
                                    // show future events on initial load

                                // if ((eventMonth === actualMonth && eventMonth === actualMonth)) {
                                    // show this months events on initial load

                                    eventStringDate = eventDay + "/" + eventMonthToShow + "/" + eventYear;
                                    if (event.url) {
                                        var eventTitle = '<a href="'+event.url+'" target="' + eventLinkTarget + '" class="eventTitle">' + event.title + '</a>';
                                    } else {
                                        var eventTitle = '<span class="eventTitle">'+event.title+'</span>';
                                    }
                                    events.push('<li id="' + key + '" class="'+event.type+'"><time datetime="'+eventDate+'"><small>'+eventHour+":"+eventMinute+'</small><em>' + eventStringDate + '</em></time>'+eventTitle+'<p class="eventDesc ' + eventDescClass + '">' + event.description + '</p></li>');
                                    i++;
                                }
                        }

                        if (((month == eventMonth) && (day == eventDay) && (year == eventYear)) || ((month == eventMonth) && (day == '') && (year == eventYear))) {
                            // when a month, day, or year is selected do this

                                    eventStringDate = eventDay + "/" + eventMonthToShow + "/" + eventYear;
                                    if (event.url) {
                                        var eventTitle = '<a href="'+event.url+'" target="' + eventLinkTarget + '" class="eventTitle">' + event.title + '</a>';
                                    } else {
                                        var eventTitle = '<span class="eventTitle">'+event.title+'</span>';
                                    }
                                    events.push('<li id="' + key + '" class="'+event.type+'"><time datetime="'+eventDate+'"><small>'+eventHour+":"+eventMinute+'</small><em>' + eventStringDate + '</em></time>'+eventTitle+'<p class="eventDesc ' + eventDescClass + '">' + event.description + '</p></li>');
                                    i++;
                        }
                    }

Original comment by Stoke...@gmail.com on 6 Dec 2013 at 4:46