Paul-DS / bootstrap-year-calendar

[DEPRECATED] A fully customizable year calendar widget, for boostrap !
Apache License 2.0
293 stars 243 forks source link

[Bug] IE11 can not display box-shadow correctly #248

Open extralam opened 5 years ago

extralam commented 5 years ago

in js Line 345 _renderDataSourceDay

we use for(var i = 0; i < events.length; i++) instead of for(var i in events)

other references topic on IE11 https://stackoverflow.com/questions/44390300/for-in-loop-in-ie11

following code updated

case 'border':
                    var weight = 0;
                    if(events.length == 1) {
                        weight = 4;
                    }
                    else if(events.length <= 3) {
                        weight = 2;
                    }
                    else {
                        elt.parent().css('box-shadow', 'inset 0 -4px 0 0 black');
                    }
                    if(weight > 0)
                    {
                        var boxShadow = '';
                        for(var i = 0; i < events.length; i++){
                            if(boxShadow != '') {
                                boxShadow += ",";
                            }
                            boxShadow += 'inset 0 -' + (parseInt(i) + 1) * weight + 'px 0 0 ' + events[i].color;
                        }
                        elt.parent().css('box-shadow', boxShadow);
                    }
                    break;