zl程序教程

您现在的位置是:首页 >  其他

当前栏目

FullCalendar 4.3.1中文模式下在IE11中显示两个月字

中文模式 显示 两个 4.3 IE11
2023-09-14 09:00:00 时间

FullCalendar 4.3.1中文模式下在IE11中显示两个月字,标题、还有提示等

如图

为了快速修改,使用简单的替换,修改main.js,找到了3出需要替换的地方

(1)

CalendarComponent.prototype.render = function (props) {
     this.freezeHeight();
     var title = this.computeTitle(props.dateProfile, props.viewSpec.options);
     if (title.indexOf("月月") != -1) {
         title = title.replace("月月", "");
     }
     this._renderToolbars(props.viewSpec, props.dateProfile, props.currentDate, props.dateProfileGenerator, title);
     this.renderView(props, title);
     this.updateSize();
     this.thawHeight();
};

(2)

function htmlEscape(s) {
        if (s.indexOf("月月") != -1) {
            s = s.replace("月月", "");
        }
        return (s + '').replace(/&/g, '&')
            .replace(/</g, '&lt;')
            .replace(/>/g, '&gt;')
            .replace(/'/g, '&#039;')
            .replace(/"/g, '&quot;')
            .replace(/\n/g, '<br />');
    }

(3)

Toolbar.prototype.updateTitle = function (text) {
     findElements(this.el, 'h2').forEach(function (titleEl) {
         if (text.indexOf("月月") != -1) {
             text = text.replace("月月", "");
         }
         titleEl.innerText = text;
     });
};

重新预览页面,问题解决