maggieraff / jmonthcalendar

Automatically exported from code.google.com/p/jmonthcalendar
Other
0 stars 0 forks source link

IE Bug w/ this.StartDateTime #33

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Setup some events in JSON, ie "2009-09-07"
2. Load page

What is the expected output? What do you see instead?
Expect: Calendar joy;
Instead: IE6: this.StartDateTime is null or not an object (line 123, char 6)

What version of the product are you using? On what operating system?
jMonthCalendar 1.3.2 beta 2 on Win 2000/IE6

Please provide any additional information below.

Original issue reported on code.google.com by brend...@gmail.com on 9 Sep 2009 at 6:48

GoogleCodeExporter commented 9 years ago
Fix: Just wrap with a check to make sure it's not null as follows:

if(this.StartDateTime != null) {                    
                    if(ev.EndDateTime) {
                        if (typeof ev.EndDateTime == 'object' && ev.EndDateTime.getDate) {
this.EndDateTime = ev.EndDateTime; }
                        if (typeof ev.EndDateTime == 'string' && ev.EndDateTime.split) {
this.EndDateTime = _getJSONDate(ev.EndDateTime); }
                    } else {
                        this.EndDateTime = this.StartDateTime.clone();
                    }

                    if
(this.StartDateTime.clone().clearTime().compareTo(this.EndDateTime.clone().clear
Time())
== 0) {
                        single.push(this);
                    } else if
(this.StartDateTime.clone().clearTime().compareTo(this.EndDateTime.clone().clear
Time())
== -1) {
                        multi.push(this);
                    }                   
                }

Original comment by brend...@gmail.com on 9 Sep 2009 at 7:04

GoogleCodeExporter commented 9 years ago

Original comment by k.leneau@gmail.com on 8 Apr 2010 at 7:24