WebCalendarjs兼容ie和火狐js日历插件Word下载.docx
- 文档编号:22088130
- 上传时间:2023-02-02
- 格式:DOCX
- 页数:30
- 大小:23.71KB
WebCalendarjs兼容ie和火狐js日历插件Word下载.docx
《WebCalendarjs兼容ie和火狐js日历插件Word下载.docx》由会员分享,可在线阅读,更多相关《WebCalendarjs兼容ie和火狐js日历插件Word下载.docx(30页珍藏版)》请在冰豆网上搜索。
//自定义定位偏移量2007-02-11由寒羽枫添加
if(document.getElementById("
ContainerPanel"
)==null){InitContainerPanel();
vardate=newDate();
varby=date.getFullYear()-50;
//最小值→50年前
varey=date.getFullYear()+50;
//最大值→50年后
//cal=newCalendar(by,ey,1,strFormat);
//初始化英文版,0为中文版
cal=(cal==null)?
newCalendar(by,ey,0):
cal;
//不用每次都初始化2006-12-03修正
cal.DateMode=pickMode["
];
//复位
if(strFormat.indexOf('
s'
)<
0){cal.DateMode=pickMode["
}//精度为分
m'
}//精度为时
h'
}//精度为日
d'
}//精度为月
M'
}//精度为年
y'
}//默认精度为秒
cal.dateFormatStyleOld=cal.dateFormatStyle;
cal.dateFormatStyle=strFormat;
cal.show(obj);
/**//**//**//**//**//**//**//**
*返回日期
*@paramdthedelimiter
*@parampthepatternofyourdate
2006-06-25由寒羽枫修改为根据用户指定的style来确定;
*/
String.prototype.toDate=function(style){
vary=this.substring(style.indexOf('
),style.lastIndexOf('
)+1);
//年
varM=this.substring(style.indexOf('
//月
vard=this.substring(style.indexOf('
//日
varh=this.substring(style.indexOf('
//时
varm=this.substring(style.indexOf('
//分
vars=this.substring(style.indexOf('
//秒
if(s==null||s=="
"
||isNaN(s)){s=newDate().getSeconds();
if(m==null||m=="
||isNaN(m)){m=newDate().getMinutes();
if(h==null||h=="
||isNaN(h)){h=newDate().getHours();
if(d==null||d=="
||isNaN(d)){d=newDate().getDate();
if(M==null||M=="
||isNaN(M)){M=newDate().getMonth()+1;
if(y==null||y=="
||isNaN(y)){y=newDate().getFullYear();
vardt;
eval("
dt=newDate('
+y+"
'
'
+(M-1)+"
'
+d+"
+h+"
+m+"
+s+"
)"
);
returndt;
*格式化日期
*@param
dthedelimiter
pthepatternofyourdate
*@author
meizz
Date.prototype.format=function(style){
varo={
M+"
:
this.getMonth()+1,//month
d+"
this.getDate(),
//day
h+"
this.getHours(),
//hour
m+"
this.getMinutes(),
//minute
s+"
this.getSeconds(),
//second
w+"
天一二三四五六"
.charAt(this.getDay()),
//week
q+"
Math.floor((this.getMonth()+3)/3),
//quarter
S"
this.getMilliseconds()//millisecond
}
if(/(y+)/.test(style)){
style=style.replace(RegExp.$1,
(this.getFullYear()+"
).substr(4-RegExp.$1.length));
for(varkino){
if(newRegExp("
("
+k+"
).test(style)){
RegExp.$1.length==1?
o[k]:
("
00"
+o[k]).substr(("
+o[k]).length));
returnstyle;
//2007-09-14
由寒羽枫添加返回所选日期
Calendar.prototype.ReturnDate=function(dt){
if(this.dateControl!
=null){this.dateControl.value=dt;
calendar.hide();
if(this.dateControl.onchange==null){return;
//将onchange转成其它函数,以免触发验证事件
varev=this.dateControl.onchange.toString();
//找出函数的字串
ev=ev.substring(
((ev.indexOf("
ValidatorOnChange();
)>
0)?
ev.indexOf("
)+20:
{"
)+1)
ev.lastIndexOf("
}"
));
//去除验证函数ValidatorOnChange();
varfun=newFunction(ev);
//重新定义函数
this.dateControl.changeEvent=fun;
this.dateControl.changeEvent();
//触发自定义changeEvent函数
*日历类
beginYear1990
endYear
2010
lang
0(中文)|1(英语)可自由扩充
dateFormatStyle
yyyy-MM-dd"
;
*@version2006-04-01
KimSoft(jinqinghua[at])
*@update
functionCalendar(beginYear,endYear,lang,dateFormatStyle){
this.beginYear=1950;
this.endYear=2050;
this.lang=0;
//0(中文)|1(英文)
this.dateFormatStyle="
yyyy-MM-ddhh:
mm:
ss"
if(beginYear!
=null&
&
endYear!
=null){
this.beginYear=beginYear;
this.endYear=endYear;
if(lang!
this.lang=lang
if(dateFormatStyle!
this.dateFormatStyle=dateFormatStyle
this.dateControl=null;
this.panel=this.getElementById("
calendarPanel"
this.container=this.getElementById("
this.form
=null;
this.date=newDate();
this.year=this.date.getFullYear();
this.month=this.date.getMonth();
this.day=this.date.getDate();
this.hour=this.date.getHours();
this.minute=this.date.getMinutes();
this.second=this.date.getSeconds();
this.colors={
cur_word"
#FFFFFF"
//当日日期文字颜色
cur_bg"
#00FF00"
//当日日期单元格背影色
sel_bg"
#FFCCCC"
//已被选择的日期单元格背影色2006-12-03寒羽枫添加
sun_word"
#FF0000"
//星期天文字颜色
sat_word"
#0000FF"
//星期六文字颜色
td_word_light"
#333333"
//单元格文字颜色
td_word_dark"
#CCCCCC"
//单元格文字暗色
td_bg_out"
#EFEFEF"
//单元格背影色
td_bg_over"
#FFCC00"
tr_word"
//日历头文字颜色
tr_bg"
#666666"
//日历头背影色
input_border"
//input控件的边框颜色
input_bg"
//input控件的背影色
/*//2008-01-29放到了show,因为要做pickMode判断
this.draw();
this.bindYear();
this.bindMonth();
*/
//this.changeSelect();
//this.bindData();
//2006-12-30由民工.砖家注释
*日历类属性(语言包,可自由扩展)
Calendar.language={
[["
],["
]],
months"
一月"
"
二月"
三月"
四月"
五月"
六月"
七月"
八月"
九月"
十月"
十一月"
十二月"
],
["
JAN"
FEB"
MAR"
APR"
MAY"
JUN"
JUL"
AUG"
SEP"
OCT"
NOV"
DEC"
]
],
weeks"
日"
一"
二"
三"
四"
五"
六"
SUN"
MON"
TUR"
WED"
THU"
FRI"
SAT"
时"
H"
分"
M"
秒"
clear"
清空"
CLS"
today"
今天"
TODAY"
pickTxt"
确定"
OK"
]],//pickMode精确到年、月时把今天变成“确定”
close"
关闭"
CLOSE"
]]
Calendar.prototype.draw=function(){
calendar=this;
varmvAry=[];
//mvAry[mvAry.length]
='
<
formname="
calendarForm"
style="
margin:
0px;
>
//因<
form>
不能嵌套,2006-12-01由寒羽枫改用Div
mvAry[mvAry.length]
divname="
tablewidth="
100%"
border="
0"
cellpadding="
cellspacing="
1"
font-size:
12px;
tr>
thalign="
left"
width="
1%"
<
inputstyle="
border:
1pxsolid'
+calendar.colors["
]+'
background-color:
width:
16px;
height:
20px;
if(calendar.DateMode>
pickMode["
]){mvAry[mvAry.length]
display:
none;
}//pickMode精确到年时隐藏“月”
='
name="
prevMonth"
type="
button"
id="
value="
lt;
/>
/th>
center"
98%"
nowrap="
nowrap"
selectname="
calendarYear"
/select>
calendarMonth"
right"
nextMonth"
gt;
/tr>
/table>
tableid="
calendarTable"
0pxsolid#CCCCCC;
#FFFFFF;
=pickMode["
}//pickMode精确到年、月时隐藏“天”
3"
for(vari=0;
i<
7;
i++){
thstyle="
font-weight:
normal;
backgro
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- WebCalendarjs 兼容 ie 火狐 js 日历 插件
![提示](https://static.bdocx.com/images/bang_tan.gif)