修改方法是在语言文件calendar-cn_utf8.js 开始部分加上
Calendar._FD = 0;
修改后的文件如下:
Calendar._FD = 0; // full day names exp:星期日 Calendar._DN = new Array ("\u5468\u65e5",//\u5468\u65e5 "\u5468\u4e00",//\u5468\u4e00 "\u5468\u4e8c",//\u5468\u4e8c "\u5468\u4e09",//\u5468\u4e09 "\u5468\u56db",//\u5468\u56db "\u5468\u4e94",//\u5468\u4e94 "\u5468\u516d",//\u5468\u516d "\u5468\u65e5");//\u5468\u65e5 // short day names exp:日 Calendar._SDN = new Array ("\u5468\u65e5", "\u5468\u4e00", "\u5468\u4e8c", "\u5468\u4e09", "\u5468\u56db", "\u5468\u4e94", "\u5468\u516d", "\u5468\u65e5"); // full month names Calendar._MN = new Array ("\u4e00\u6708", "\u4e8c\u6708", "\u4e09\u6708", "\u56db\u6708", "\u4e94\u6708", "\u516d\u6708", "\u4e03\u6708", "\u516b\u6708", "\u4e5d\u6708", "\u5341\u6708", "\u5341\u4e00\u6708", "\u5341\u4e8c\u6708"); // short month names Calendar._SMN = new Array ("\u4e00\u6708", "\u4e8c\u6708", "\u4e09\u6708", "\u56db\u6708", "\u4e94\u6708", "\u516d\u6708", "\u4e03\u6708", "\u516b\u6708", "\u4e5d\u6708", "\u5341\u6708", "\u5341\u4e00\u6708", "\u5341\u4e8c\u6708"); // tooltips Calendar._TT = {}; Calendar._TT["INFO"] = "\u5173\u4e8e"; Calendar._TT["ABOUT"] = " DHTML \u65e5\u8d77/\u65f6\u95f4\u9009\u62e9\u63a7\u4ef6\n" + "(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) "For latest version visit: \u6700\u65b0\u7248\u672c\u8bf7\u767b\u9646http://www.dynarch.com/projects/calendar/\u5bdf\u770b\n" + "\u9075\u5faaGNU LGPL. \u7ec6\u8282\u53c2\u9605 http://gnu.org/licenses/lgpl.html" + "\n\n" + "\u65e5\u671f\u9009\u62e9:\n" + "- \u70b9\u51fb\xab(\xbb)\u6309\u94ae\u9009\u62e9\u4e0a(\u4e0b)\u4e00\u5e74\u5ea6.\n" + "- \u70b9\u51fb" + String.fromCharCode(0x2039) + "(" + String.fromCharCode(0x203a) + ")\u6309\u94ae\u9009\u62e9\u4e0a(\u4e0b)\u4e2a\u6708\u4efd.\n" + "- \u957f\u65f6\u95f4\u6309\u7740\u6309\u94ae\u5c06\u51fa\u73b0\u66f4\u591a\u9009\u62e9\u9879."; Calendar._TT["ABOUT_TIME"] = "\n\n" + "\u65f6\u95f4\u9009\u62e9:\n" + "-\u5728\u65f6\u95f4\u90e8\u5206(\u5206\u6216\u8005\u79d2)\u4e0a\u5355\u51fb\u9f20\u6807\u5de6\u952e\u6765\u589e\u52a0\u5f53\u524d\u65f6\u95f4\u90e8\u5206(\u5206\u6216\u8005\u79d2)\n" + "-\u5728\u65f6\u95f4\u90e8\u5206(\u5206\u6216\u8005\u79d2)\u4e0a\u6309\u4f4fShift\u952e\u540e\u5355\u51fb\u9f20\u6807\u5de6\u952e\u6765\u51cf\u5c11\u5f53\u524d\u65f6\u95f4\u90e8\u5206(\u5206\u6216\u8005\u79d2)."; Calendar._TT["PREV_YEAR"] = "\u4e0a\u4e00\u5e74"; Calendar._TT["PREV_MONTH"] = "\u4e0a\u4e2a\u6708"; Calendar._TT["GO_TODAY"] = "\u5230\u4eca\u5929"; Calendar._TT["NEXT_MONTH"] = "\u4e0b\u4e2a\u6708"; Calendar._TT["NEXT_YEAR"] = "\u4e0b\u4e00\u5e74"; Calendar._TT["SEL_DATE"] = "\u9009\u62e9\u65e5\u671f"; Calendar._TT["DRAG_TO_MOVE"] = "\u62d6\u52a8"; Calendar._TT["PART_TODAY"] = " (\u4eca\u5929)"; // the following is to inform that "%s" is to be the first day of week // %s will be replaced with the day name. Calendar._TT["DAY_FIRST"] = "%s\u4e3a\u8fd9\u5468\u7684\u7b2c\u4e00\u5929"; // This may be locale-dependent. It specifies the week-end days, as an array // of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 // means Monday, etc. Calendar._TT["WEEKEND"] = "0,6"; Calendar._TT["CLOSE"] = "\u5173\u95ed"; Calendar._TT["TODAY"] = "\u4eca\u5929"; Calendar._TT["TIME_PART"] = "(\u6309\u7740Shift\u952e)\u5355\u51fb\u6216\u62d6\u52a8\u6539\u53d8\u503c"; // date formats Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d"; Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e\u65e5"; Calendar._TT["WK"] = "\u5468"; Calendar._TT["TIME"] = "\u65f6\u95f4:";
同时在用到该控件的页面必须加上
附:今天在另外一个JSP页面用到的时候,出现了弹出的面板不显示任何日期的情况,检查了N遍,发现与好用的页面代码相同,但是尝试了多种方法后问题依然存在。
最后将日期js文件在页面调用的路径更改了一下,这样当然找不到了,报错;然后再改回来,这下竟然好用了。
具体什么原因我也不知道。经常变动JSP页面内容的时候有时我们会发现,其实页面的语句是正确的,但是在Ecpipse中仍然显示有问题,没有办法你必须将这个语句改错误,然后保存,之后再改回来,再保存,语句没有问题多数情况问题会解决。
好多人都遇见过这样的问题,为甚么这么解决它们也不知道具体原因,大概JSP页面被编译后驻留在内存中,和这个有关吧。