日期:2014-05-16  浏览次数:20442 次

js日历出错,帮忙查找下原因。
帮忙看一下这个日历,
HTML代码:<script type="text/javascript" language="javascript" src="popCalendar.js"></script>
<input  onclick="popCalendar(this,'y-m-d')"    />   
出错的原因就是选择一月出错,跳转到12月了。。有哪位JS高手帮忙找下原因看下。

function L_calendar() { }
L_calendar.prototype = {
    _VersionInfo: "Version:1.0&#13;作者: lingye",
    OutMode: "",
    Moveable: true,
    NewName: "",
    insertId: "",
    ClickObject: null,
    InputObject: null,
    InputDate: null,
    IsOpen: false,
    MouseX: 0,
    MouseY: 0,
    GetDateLayer: function () {
        return window.L_DateLayer;
    },
    L_TheYear: new Date().getFullYear(), //定义年的变量的初始值
    L_TheMonth: new Date().getMonth() + 1, //定义月的变量的初始值
    L_WDay: new Array(39), //定义写日期的数组
    MonHead: new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31),        //定义阳历中每个月的最大天数
    GetY: function () {
        var obj;
        if (arguments.length > 0) {
            obj == arguments[0];
        }
        else {
            obj = this.ClickObject;
        }
        if (obj != null) {
            var y = obj.offsetTop;
            while (obj = obj.offsetParent) y += obj.offsetTop;
            return y;
        }
        else { return 0; }
    },
    GetX: function () {
        var obj;
        if (arguments.length > 0) {
            obj == arguments[0];

        }
        else {
            obj = this.ClickObject;
        }
        if (obj != null) {
            var y = obj.offsetLeft;
            while (obj = obj.offsetParent) y += obj.