如何从一个new date yyyy mm dd/mm/dd hh:mm:ss格式的日期里提取到yy/mm/dd这个格式

【Java】怎样获取当前系统时间,需要的格式为yyyy-MM-dd HH:mm:ss_百度知道
【Java】怎样获取当前系统时间,需要的格式为yyyy-MM-dd HH:mm:ss
我是以ibatis为框架写的程序,需要在web层里边写~~我其他字段是这样写的:pmWorkdiary.setCreateuser(userName);时间也要这样写,而且格式要是yyyy-MM-dd HH:mm:ss的,怎么获取然后显示啊?
我在实体类定义Date的类型为String
我有更好的答案
SimpleDateFormat sdf=new SimpleDateFormat(&yyyy-MM-dd HH:mm:ss&);
String time=
sdf.format( new
这个字符串 time已经成为你要的格式了字符串变dateDate date=sdf.parse(time);
采纳率:42%
public void getCurrentDate(){ Date date = new Date(); SimpleDateFormat sdf = new SimpleDateFormat(); sdf.applyPattern(&yyyy-MM-dd&); System.out.println(sdf.format(date));
导入包:import java.text.SimpleDateFimport java.util.D在输入以下获取代码就可以啦 SimpleDateFormat formater=new SimpleDateFormat(&yyyy-MM-dd
HH:mm:ss&);
String strCurrentTime=formater.format(new Date());
System.out.print(strCurrentTime);
貌似直接new Date();就可以了然后调用它的getDate()方法
其他1条回答
为您推荐:
其他类似问题
java的相关知识
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。当前位置: →
→ 如何从一个y/mm/ddhh:mm:ss格式的日期里提取到yy/mm/dd这个格式
如何从一个y/mm/ddhh:mm:ss格式的日期里提取到yy/mm/dd这个格式
& 作者:佚名 & 来源: 互联网 & 热度:
&收藏到→_→:
摘要: 怎么从一个yyyy/mm/dd hh:mm:ss格式的日期里提取到yy/mm/dd这个格式比如: 4:00:00怎么得到?还有判断2个日...
"如何从一个y/mm/ddhh:mm:ss格式的日期里提取到yy/mm/dd这个格式"::
怎么从一个yyyy/mm/dd hh:mm:ss格式的日期里提取到yy/mm/dd这个格式比如: 4:00:00怎么得到?还有判断2个日期格式相等,是用=好吗?如果判断1个日期范围在另一个范围内,是用&好吗?比如:to_date('','yyyy/mm/dd')&table.time&to_date('','yyyy/mm/dd')------解决方案--------------------sql code
select to_char(to_date(' 4:00:00', 'yyyy/mm/dd hh24:mi:ss'), 'yyyy/mm/dd') tar_date
------解决方案--------------------select trunc(时间字段名) from tb --这个不准确select to_char(时间字段名,'yyyy/mm/dd') from tb --这个准确select * from tb where trunc(时间字段名) between '' and '' --这个不准确select * from tb where to_char(时间字段名,'yyyy/mm/dd') between '' and '' --这个准确
------解决方案--------------------探讨我这个 4:00:00,已经是日期格式了。另外一个是字符型的,我想用to_date('','yyyy-mm-dd'),转成日期型的和前面的值比较,行吗? 搜索此文相关文章:此文来自: 马开东博客
网址: 站长QQ
上一篇:没有了
如何从一个y/mm/ddhh:mm:ss格式的日期里提取到yy/mm/dd这个格式_Oracle开发相关文章
Oracle开发_总排行榜
Oracle开发_最新
Oracle开发_月排行榜
Oracle开发_周排行榜
Oracle开发_日排行榜/ finance-yan
项目语言:None
权限:read-only(如需更高权限请先加入项目)
finance-yan/
Index: skin/red.css
===================================================================
--- skin/red.css (revision 0)
+++ skin/red.css (revision 2)
@@ -0,0 +1,82 @@
+@charset &utf-8&;
+/* CSS Document */
+body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,address,big,cite,code,del,dfn,em,img,ins,q,s,samp,small,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,section,summary,time,mark,audio,video{margin: 0;padding: 0;}
+article,aside,header,footer,nav,section,figure,figcaption,hgroup,progress,canvas{display:block}
+body{-webkit-text-size-adjust:100%;}
+input, select, label {vertical-align:}
+button,input{line-height:normal}
+ul,ol,li,dl{list-style-type:}
i,em{font-style:normal}
svg:not(:root){overflow:hidden}
+img{vertical-align:border:0;-ms-interpolation-mode:-webkit-tap-highlight-color:rgba(0,0,0,0);}
+.jedatebox{width:298height: border:1px #D91600background-color:#font-family:'microsoft yahei',Verdana,&\u5fae\u8f6f\u96c5\u9ed1&,&\5b8b\4f53&,Afont-size:14 cursor:}
+.jedatebox.dateshow{display:}
+.jedatebox .jedatetop{width:100%;background: #D91600; color:# overflow:text-align:}
+.jedatebox .jedateym{float:height:40 line-height:40}
+.jedateym span{width:70%;padding: 0;float:text-align:text-overflow: display:}
+.jedateym span input{width:100%;float:padding: 0;border:background-color:text-align:}
+.jedateym .prev,.jedateym .next{width:15%;height:40 line-height:45float:display:text-align:}
+.jedateym .prev:before{width: 0;height: 0; display:inline-border-width: 7 border-style:border-color:overflow:border-right-style: border-right-color:#content: &&;margin: 0 9px 0 0;}
+.jedateym .next:before{width: 0;height: 0; display:inline-border-width: 7 border-style:border-color:overflow:border-left-style: border-left-color:#content: &&;margin: 0 0 0 6}
+.jedateym .pndrop{width:14height:14 overflow:display: inline-position:vertical-align:}
+.jedateym .pndrop:before{width: 0;height: 0; display:inline-border-width:5 border-style:border-color:overflow:border-top-style: border-top-color:#content: &&; position: top:4 left:2}
+.jedatesety,.jedatesetm{width: 100%; position:left:0; top:40 bottom:0;background-color: # z-index:50;}
+.jedatesety .ymdropul,.jedatesetm .ymdropul{width:100%;height:210overflow:}
+.jedatesety .ymdropul li{width:33.3%;float:text-align:height:40 line-height:40}
+.jedatesetm .ymdropul li{width:33.3%;float:text-align:height:50 line-height:50}
+.jedatesety .ymdropul li:hover,.jedatesetm .ymdropul li:hover{background: #FFEAE8;}
+.jedatesety .ymdropul li.action,.jedatesetm .ymdropul li.action{background: #D91600;color:#}
+.jedatesety .ymdropul li.action:hover,.jedatesetm .ymdropul li.action:hover{background: #FFEAE8;color:#}
+.jedatetopym p{overflow: padding-top:4}
+.jedatetopym p span{width:31%; margin:0 1.1%;background-color: #D91600;color: #display:height:28line-height:28 border-radius:5text-align:}
+.jedatetopym p span.jedateymchri{background-color: #FFEAE8;color: #1F547E;float:font-size: 16}
+.jedatetopym p span.jedateymchle{background-color: #FFEAE8;color: #1F547E;float:font-size: 16}
+.jedatetopym p span.jedateymchok{background-color: #D91600;color:#float:font-size: 12}
+.jedatebox .jedaym{height:202overflow: padding:5}
+.jedatebox .jedaym li{width:50%;float:text-align:height:32 line-height:32}
+.jedatebox .jedaym li.action,.jedatebox .jedaym li.action:hover{background: #D91600;color:#}
+.jedatebox .jedaym li:hover{background: #FFEAE8;}
+.jedatebox .jedaol{width:100%;overflow:}
+.jedatebox .jedaul{ padding:0 4overflow:}
+.jedatebox .jedaol li,.jedatebox .jedaul li{width:14.28%; float: height:30 line-height:30 text-align: position: overflow:}
+.jedatebox .jedaul li{width:14.28%;float:}
+.jedatebox .jedaol li.weeks{background:#f5f5f5;border-bottom: 1px solid #}
+.jedatebox .jedaul li.action,.jedatebox .jedaul li.action:hover{background: #D91600;color:#}
+.jedatebox .jedaul li.prevdate,.jedatebox .jedaul li.nextdate{color:#FFBAB3;}
+.jedatebox .jedaul li.disabled{ color:#}
+.jedatebox .jedaul li.disabled:hover{background:#}
+.jedatebox .jedaul li:nth-child(7n){border-right:}
+.jedatebox .jedaul li:hover{background: #FFEAE8;}
+.jedatebox .jedaul li .marks{ width:5 height:5 background:#ff0000; -webkit-border-radius:50%;border-radius:50%; position: right:2 top:4}
+.jedatebox .jedaul li.action .marks{ width:5 height:5 background:# -webkit-border-radius:50%;border-radius:50%; position: right:2 top:4}
+.jedatebot{height:34line-height:34 padding:0 3px 0 5overflow:background:#f5f5f5;}
+.jedatebot .botflex{width:50%;float:display: inline-margin:0;padding-top:3 overflow:}
+.jedatebot .botflex li{width:33.33%; float:text-align:}
+.jedatebot .botflex li em{width:70%;float:padding: 0;border:text-align:display:height:26line-height:26}
+.jedatebot .botflex li i{width:30%;float:height:26line-height:24font-style:display:text-align:}
+.jedatebot .jedatebtn{text-align:font-size: 12}
+.jedatebot .jedatebtn span{width:31%;float: margin:0 1.1%;background-color: #D91600;color: #display:height:28line-height:28 border-radius:5text-align:}
+.jedatebot .jedatehms{border:1px #background-color: #margin:0px 5% 3px 0;padding:0 0 0 8display:overflow:}
+/*.jedateh,.jedatems{width: 100%; position:left:0; bottom:40background-color: #border-top: 1px solid #}*/
+.jedateprophms{width: 100%;}
+.jedateproppos{position:left:0; top:0 padding-top:40 display:}
+.jedatepropfix{display:}
+.jedatepropcon{width: 100%; padding-bottom:9background-color: # overflow:}
+.jedatehmstitle{width:100%;height:30line-height:30background: #f5f5f5; color:#000;border-bottom: 1px solid #position: overflow:text-align:font-size: 15}
+.jedateproptext{width:86 float:height:30line-height:30 text-align:margin-left:10}
+.jedatehmscon{width:84height:140 float: overflow-y:border: 1px solid # margin:0px 0px 0px 10}
+.jedatehmscon p{width:100%;float:text-align:height:28 line-height:28}
+.jedatehmscon p.action{background: #D91600;color:#}
+.jedatehmscon p.disabled{ color:#}
+.jedatems p{width:10%;float:text-align:height:32 line-height:32}
+.jedateh p.action,.jedatems p.action{background: #D91600;color:#}
+.jedatehmsclose{width:30 height:30 line-height:26 text-align:position:top:50%;right:4 margin-top:-15z-index:150;font-size:24}
+.jedatehmscon::-webkit-scrollbar{height:6width:6margin-right:5background: #f5f5f5;transition:all 0.3s ease-in-border-radius:0px}
+.jedatehmscon::-webkit-scrollbar-track { -webkit-border-radius: 0border-radius: 0}
+.jedatehmscon::-webkit-scrollbar-thumb{-webkit-border-radius: 0border-radius: 0background: rgba(0,0,0,0.5); }
+.jedatehmscon::-webkit-scrollbar-thumb:hover{background:rgba(0,0,0,0.6)}
+.jedatehmscon::-webkit-scrollbar-thumb:active{background:rgba(0,0,0,0.8)}
+.jedatehmscon::-webkit-scrollbar-thumb:window-inactive {background: rgba(0,0,0,0.4);}
\ No newline at end of file
Index: skin/jedate.css
===================================================================
--- skin/jedate.css (revision 0)
+++ skin/jedate.css (revision 2)
@@ -0,0 +1,86 @@
+@charset &utf-8&;
+/* CSS Document */
+.jedatebox{width:298height: border:1px #00A1CBbackground-color:#font-family:'microsoft yahei',Verdana,&\u5fae\u8f6f\u96c5\u9ed1&,&\5b8b\4f53&,Afont-size:14 cursor:margin: 0;padding: 0;}
+.jedatebox div,.jedatebox ol,.jedatebox ul,.jedatebox li,.jedatebox p,.jedatebox span{margin: 0;padding: 0;list-style-type:}
+.jedatebox em,.jedatebox i{margin: 0;padding: 0;font-style:}
+.jedatebox.dateshow{display:}
+.jedatebox .jedatetop{width:100%;background: #00A1CB; color:# overflow:text-align:}
+.jedatebox .jedateym{float:height:40 line-height:40}
+.jedatebox .jedateym span{width:70%;padding: 0;float:text-align:text-overflow: display:}
+.jedatebox .jedateym span input{width:100%;float:padding: 0;border:background-color:text-align:}
+.jedatebox .jedateym .prev,.jedatebox .jedateym .next{width:15%;height:40 line-height:45float:display:text-align:}
+.jedatebox .jedateym .prev:before{width: 0;height: 0; display:inline-border-width: 7 border-style:border-color:overflow:border-right-style: border-right-color:#content: &&;margin: 0 9px 0 0;}
+.jedatebox .jedateym .next:before{width: 0;height: 0; display:inline-border-width: 7 border-style:border-color:overflow:border-left-style: border-left-color:#content: &&;margin: 0 0 0 6}
+.jedatebox .jedateym .triangle:hover{background-color:#00B9E8;}
+.jedatebox .jedateym .pndrop{width:14height:14 overflow:display: inline-position:vertical-align:}
+.jedatebox .jedateym .pndrop:before{width: 0;height: 0; display:inline-border-width:5 border-style:border-color:overflow:border-top-style: border-top-color:#content: &&; position: top:4 left:2}
+.jedatebox .jedatesety,.jedatebox .jedatesetm{width: 100%; position:left:0; top:40 bottom:0;background-color: # z-index:50;}
+.jedatebox .jedatesety .ymdropul,.jedatebox .jedatesetm .ymdropul{width:100%;height:210overflow:}
+.jedatebox .jedatesety .ymdropul li{width:33.3%;float:text-align:height:40 line-height:40}
+.jedatebox .jedatesetm .ymdropul li{width:33.3%;float:text-align:height:50 line-height:50}
+.jedatebox .jedatesety .ymdropul li:hover,.jedatebox .jedatesetm .ymdropul li:hover{background: #ECF4FB;}
+.jedatebox .jedatesety .ymdropul li.action,.jedatebox .jedatesetm .ymdropul li.action{background: #00A1CB;color:#}
+.jedatebox .jedatesety .ymdropul li.action:hover,.jedatebox .jedatesetm .ymdropul li.action:hover{background: #00A1CB;color:#}
+.jedatebox .jedatetopym p{overflow: padding-top:4}
+.jedatebox .jedatetopym p span{width:31%; margin:0 1.1%;background-color: #00A1CB;color: #display:height:28line-height:28 border-radius:5text-align:}
+.jedatebox .jedatetopym p span.jedateymchri{background-color: #ECF4FB;color: #1F547E;float:font-size: 16}
+.jedatebox .jedatetopym p span.jedateymchle{background-color: #ECF4FB;color: #1F547E;float:font-size: 16}
+.jedatebox .jedatetopym p span.jedateymchok{background-color: #00A1CB;color:#float:font-size: 12}
+.jedatebox .jedayy,.jedatebox .jedaym{height:202overflow: padding:5}
+.jedatebox .jedayy li{width:33.3%;float:text-align:height:38 line-height:38}
+.jedatebox .jedayy li.action,.jedatebox .jedayy li.action:hover{background: #00A1CB;color:#}
+.jedatebox .jedayy li:hover{background: #ECF4FB;}
+.jedatebox .jedayy li.disabled{ color:#}
+.jedatebox .jedaym li{width:50%;float:text-align:height:32 line-height:32}
+.jedatebox .jedaym li.action,.jedatebox .jedaym li.action:hover{background: #00A1CB;color:#}
+.jedatebox .jedaym li:hover{background: #ECF4FB;}
+.jedatebox .jedaym li.disabled { color: #
+.jedatebox .jedaol{width:100%;overflow:}
+.jedatebox .jedaul{ padding:4overflow:}
+.jedatebox .jedaol li,.jedatebox .jedaul li{width:14.28%; float: height:30 line-height:30 text-align: position: overflow:}
+.jedatebox .jedaul li{width:14.28%;float:}
+.jedatebox .jedaol li.weeks{background:#f5f5f5;border-bottom: 1px solid #}
+.jedatebox .jedaul li.action,.jedatebox .jedaul li.action:hover{background: #00A1CB;color:#}
+.jedatebox .jedaul li.other{color:#4DDBFF;}
+.jedatebox .jedaul li.disabled{ color:#}
+.jedatebox .jedaul li.disabled:hover{background:#}
+.jedatebox .jedaul li:nth-child(7n){border-right:}
+.jedatebox .jedaul li:hover{background: #ECF4FB;}
+.jedatebox .jedaul li.red{ color:#ff0000;}
+.jedatebox .jedaul li .marks{ width:5 height:5 background:#ff0000; -webkit-border-radius:50%;border-radius:50%; position: right:2 top:4}
+.jedatebox .jedaul li.action .marks{ width:5 height:5 background:# -webkit-border-radius:50%;border-radius:50%; position: right:2 top:4}
+.jedatebox .jedatebot{height:34line-height:34 padding:0 3px 0 5overflow:background:#f5f5f5;}
+.jedatebox .jedatebot .jedatehms{border:1px #background-color: #margin:0px 5% 3px 0;padding-left:1display:overflow:}
+.jedatebox .jedatebot .botflex{width:50%;float:display: inline-margin:0;padding-top:3 overflow:}
+.jedatebox .jedatebot .botflex li{width:36 float:text-align:}
+.jedatebox .jedatebot .botflex li input{width:100%;float:padding: 0;border:text-align:display:height:26line-height:26text-decoration:outline:-moz-outline:font-size: 14}
+.jedatebox .jedatebot .botflex i{width:12float:height:26line-height:24font-style:display:text-align:background: #f2f2f2; font-weight:900;}
+.jedatebox .jedatebot .jedatebtn{text-align:font-size: 12}
+.jedatebox .jedatebot .jedatebtn span{width:31%;float: margin:0 1.1%;background-color: #00A1CB;color: #display:height:28line-height:28 border-radius:5text-align:}
+.jedatebox .jedateprophms{width: 100%;}
+.jedatebox .jedateproppos{position:left:0; top:0 padding-top:40 display:}
+.jedatebox .jedatepropfix{display:}
+.jedatebox .jedatepropcon{padding:30px 5px 17px 5background-color: # overflow:position:}
+.jedatebox .jedatehmstitle{width:100%;height:30line-height:30position:left:0;top:0;background: #f5f5f5; color:#000;border-bottom: 1px solid #overflow:text-align:font-size: 15}
+.jedatebox .jedateproptext{width:83 float:height:30line-height:30 text-align:margin-left:10}
+.jedatebox .jedatehmscon{width:81height:140 float: overflow-y:border: 1px solid # margin:0px 0px 0px 10}
+.jedatebox .jedatehmscon p{width:100%;float:text-align:height:28 line-height:28}
+.jedatebox .jedatehmscon p:hover{background: #ECF4FB;}
+.jedatebox .jedatehmscon p.action,.jedatebox .jedatehmscon p.action:hover{background: #00A1CB;color:#}
+.jedatebox .jedatehmscon p.disabled{ color:#}
+.jedatebox .jedatems p{width:10%;float:text-align:height:32 line-height:32}
+.jedatebox .jedateh p.action,.jedatebox .jedatems p.action{background: #00A1CB;color:#}
+.jedatebox .jedatehmsclose{width:30 height:30 line-height:26 text-align:position:top:50%;right:4 margin-top:-15z-index:150;font-size:24}
+.jedatebox .jedatehmscon::-webkit-scrollbar{height:6width:6margin-right:5background: #f5f5f5;transition:all 0.3s ease-in-border-radius:0px}
+.jedatebox .jedatehmscon::-webkit-scrollbar-track { -webkit-border-radius: 0border-radius: 0}
+.jedatebox .jedatehmscon::-webkit-scrollbar-thumb{-webkit-border-radius: 0border-radius: 0background: rgba(0,0,0,0.5); }
+.jedatebox .jedatehmscon::-webkit-scrollbar-thumb:hover{background:rgba(0,0,0,0.6)}
+.jedatebox .jedatehmscon::-webkit-scrollbar-thumb:active{background:rgba(0,0,0,0.8)}
+.jedatebox .jedatehmscon::-webkit-scrollbar-thumb:window-inactive {background: rgba(0,0,0,0.4);}
Index: skin/green.css
===================================================================
--- skin/green.css (revision 0)
+++ skin/green.css (revision 2)
@@ -0,0 +1,83 @@
+@charset &utf-8&;
+/* CSS Document */
+body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,address,big,cite,code,del,dfn,em,img,ins,q,s,samp,small,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,section,summary,time,mark,audio,video{margin: 0;padding: 0;}
+article,aside,header,footer,nav,section,figure,figcaption,hgroup,progress,canvas{display:block}
+body{-webkit-text-size-adjust:100%;}
+input, select, label {vertical-align:}
+button,input{line-height:normal}
+ul,ol,li,dl{list-style-type:}
i,em{font-style:normal}
svg:not(:root){overflow:hidden}
+img{vertical-align:border:0;-ms-interpolation-mode:-webkit-tap-highlight-color:rgba(0,0,0,0);}
+.jedatebox{width:298height: border:1px #78BA32background-color:#font-family:'microsoft yahei',Verdana,&\u5fae\u8f6f\u96c5\u9ed1&,&\5b8b\4f53&,Afont-size:14 cursor:}
+.jedatebox.dateshow{display:}
+.jedatebox .jedatetop{width:100%;background: #78BA32; color:# overflow:text-align:}
+.jedatebox .jedateym{float:height:40 line-height:40}
+.jedateym span{width:70%;padding: 0;float:text-align:text-overflow: display:}
+.jedateym span input{width:100%;float:padding: 0;border:background-color:text-align:}
+.jedateym .prev,.jedateym .next{width:15%;height:40 line-height:45float:display:text-align:}
+.jedateym .prev:before{width: 0;height: 0; display:inline-border-width: 7 border-style:border-color:overflow:border-right-style: border-right-color:#content: &&;margin: 0 9px 0 0;}
+.jedateym .next:before{width: 0;height: 0; display:inline-border-width: 7 border-style:border-color:overflow:border-left-style: border-left-color:#content: &&;margin: 0 0 0 6}
+.jedateym .pndrop{width:14height:14 overflow:display: inline-position:vertical-align:}
+.jedateym .pndrop:before{width: 0;height: 0; display:inline-border-width:5 border-style:border-color:overflow:border-top-style: border-top-color:#content: &&; position: top:4 left:2}
+.jedatesety,.jedatesetm{width: 100%; position:left:0; top:40 bottom:0;background-color: # z-index:50;}
+.jedatesety .ymdropul,.jedatesetm .ymdropul{width:100%;height:210overflow:}
+.jedatesety .ymdropul li{width:33.3%;float:text-align:height:40 line-height:40}
+.jedatesetm .ymdropul li{width:33.3%;float:text-align:height:50 line-height:50}
+.jedatesety .ymdropul li:hover,.jedatesetm .ymdropul li:hover{background: #EFF9E6;}
+.jedatesety .ymdropul li.action,.jedatesetm .ymdropul li.action{background: #78BA32;color:#}
+.jedatesety .ymdropul li.action:hover,.jedatesetm .ymdropul li.action:hover{background: #ECF4FB;color:#}
+.jedatetopym p{overflow: padding-top:4}
+.jedatetopym p span{width:31%; margin:0 1.1%;background-color: #78BA32;color: #display:height:28line-height:28 border-radius:5text-align:}
+.jedatetopym p span.jedateymchri{background-color: #ECF4FB;color: #1F547E;float:font-size: 16}
+.jedatetopym p span.jedateymchle{background-color: #ECF4FB;color: #1F547E;float:font-size: 16}
+.jedatetopym p span.jedateymchok{background-color: #78BA32;color:#float:font-size: 12}
+.jedatebox .jedaym{height:202overflow: padding:5}
+.jedatebox .jedaym li{width:50%;float:text-align:height:32 line-height:32}
+.jedatebox .jedaym li.action,.jedatebox .jedaym li.action:hover{background: #78BA32;color:#}
+.jedatebox .jedaym li:hover{background: #ECF4FB;}
+.jedatebox .jedaol{width:100%;overflow:}
+.jedatebox .jedaul{ padding:0 4overflow:}
+.jedatebox .jedaol li,.jedatebox .jedaul li{width:14.28%; float: height:30 line-height:30 text-align: position: overflow:}
+.jedatebox .jedaul li{width:14.28%;float:}
+.jedatebox .jedaol li.weeks{background:#f5f5f5;border-bottom: 1px solid #}
+.jedatebox .jedaul li.action,.jedatebox .jedaul li.action:hover{background: #78BA32;color:#}
+.jedatebox .jedaul li.prevdate,.jedatebox .jedaul li.nextdate{color:#CAE8AA;}
+.jedatebox .jedaul li.disabled{ color:#}
+.jedatebox .jedaul li.disabled:hover{background:#}
+.jedatebox .jedaul li:nth-child(7n){border-right:}
+.jedatebox .jedaul li:hover{background: #EFF9E6;}
+.jedatebox .jedaul li .marks{ width:5 height:5 background:#ff0000; -webkit-border-radius:50%;border-radius:50%; position: right:2 top:4}
+.jedatebox .jedaul li.action .marks{ width:5 height:5 background:# -webkit-border-radius:50%;border-radius:50%; position: right:2 top:4}
+.jedatebot{height:34line-height:34 padding:0 3px 0 5overflow:background:#f5f5f5;}
+.jedatebot .botflex{width:50%;float:display: inline-margin:0;padding-top:3 overflow:}
+.jedatebot .botflex li{width:33.33%; float:text-align:}
+.jedatebot .botflex li em{width:70%;float:padding: 0;border:text-align:display:height:26line-height:26}
+.jedatebot .botflex li i{width:30%;float:height:26line-height:24font-style:display:text-align:}
+.jedatebot .jedatebtn{text-align:font-size: 12}
+.jedatebot .jedatebtn span{width:31%;float: margin:0 1.1%;background-color: #78BA32;color: #display:height:28line-height:28 border-radius:5text-align:}
+.jedatebot .jedatehms{border:1px #background-color: #margin:0px 5% 3px 0;padding:0 0 0 8display:overflow:}
+/*.jedateh,.jedatems{width: 100%; position:left:0; bottom:40background-color: #border-top: 1px solid #}*/
+.jedateprophms{width: 100%;}
+.jedateproppos{position:left:0; top:0 padding-top:40 display:}
+.jedatepropfix{display:}
+.jedatepropcon{width: 100%; padding-bottom:9background-color: # overflow:}
+.jedatehmstitle{width:100%;height:30line-height:30background: #f5f5f5; color:#000;border-bottom: 1px solid #position: overflow:text-align:font-size: 15}
+.jedateproptext{width:86 float:height:30line-height:30 text-align:margin-left:10}
+.jedatehmscon{width:84height:140 float: overflow-y:border: 1px solid # margin:0px 0px 0px 10}
+.jedatehmscon p{width:100%;float:text-align:height:28 line-height:28}
+.jedatehmscon p.action{background: #78BA32;color:#}
+.jedatehmscon p.disabled{ color:#}
+.jedatems p{width:10%;float:text-align:height:32 line-height:32}
+.jedateh p.action,.jedatems p.action{background: #78BA32;color:#}
+.jedatehmsclose{width:30 height:30 line-height:26 text-align:position:top:50%;right:4 margin-top:-15z-index:150;font-size:24}
+.jedatehmscon::-webkit-scrollbar{height:6width:6margin-right:5background: #f5f5f5;transition:all 0.3s ease-in-border-radius:0px}
+.jedatehmscon::-webkit-scrollbar-track { -webkit-border-radius: 0border-radius: 0}
+.jedatehmscon::-webkit-scrollbar-thumb{-webkit-border-radius: 0border-radius: 0background: rgba(0,0,0,0.5); }
+.jedatehmscon::-webkit-scrollbar-thumb:hover{background:rgba(0,0,0,0.6)}
+.jedatehmscon::-webkit-scrollbar-thumb:active{background:rgba(0,0,0,0.8)}
+.jedatehmscon::-webkit-scrollbar-thumb:window-inactive {background: rgba(0,0,0,0.4);}
Index: skin/gray.css
===================================================================
--- skin/gray.css (revision 0)
+++ skin/gray.css (revision 2)
@@ -0,0 +1,83 @@
+@charset &utf-8&;
+/* CSS Document */
+body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,address,big,cite,code,del,dfn,em,img,ins,q,s,samp,small,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,section,summary,time,mark,audio,video{margin: 0;padding: 0;}
+article,aside,header,footer,nav,section,figure,figcaption,hgroup,progress,canvas{display:block}
+body{-webkit-text-size-adjust:100%; margin:0;}
+input, select, label {vertical-align:}
+button,input{line-height:normal}
+ul,ol,li,dl{list-style-type:}
i,em{font-style:normal}
svg:not(:root){overflow:hidden}
+img{vertical-align:border:0;-ms-interpolation-mode:-webkit-tap-highlight-color:rgba(0,0,0,0);}
+.jedatebox{width:298height: border:1px #background-color:#font-family:'microsoft yahei',Verdana,&\u5fae\u8f6f\u96c5\u9ed1&,&\5b8b\4f53&,Afont-size:14 cursor:}
+.jedatebox.dateshow{display:}
+.jedatebox .jedatetop{width:100%;background: #F5F5F5; color:#333; overflow:text-align:}
+.jedatebox .jedateym{float:height:40 line-height:40}
+.jedateym span{width:70%;padding: 0;float:text-align:text-overflow: display:}
+.jedateym span input{width:100%;float:padding: 0;border:background-color:text-align:}
+.jedateym .prev,.jedateym .next{width:15%;height:40 line-height:45float:display:text-align:}
+.jedateym .prev:before{width: 0;height: 0; display:inline-border-width: 7 border-style:border-color:overflow:border-right-style: border-right-color:#999;content: &&;margin: 0 9px 0 0;}
+.jedateym .next:before{width: 0;height: 0; display:inline-border-width: 7 border-style:border-color:overflow:border-left-style: border-left-color:#999;content: &&;margin: 0 0 0 6}
+.jedateym .pndrop{width:14height:14 overflow:display: inline-position:vertical-align:}
+.jedateym .pndrop:before{width: 0;height: 0; display:inline-border-width:5 border-style:border-color:overflow:border-top-style: border-top-color:#999;content: &&; position: top:4 left:2}
+.jedatesety,.jedatesetm{width: 100%; position:left:0; top:40 bottom:0;background-color: # z-index:50;}
+.jedatesety .ymdropul,.jedatesetm .ymdropul{width:100%;height:210overflow:}
+.jedatesety .ymdropul li{width:33.3%;float:text-align:height:40 line-height:40}
+.jedatesetm .ymdropul li{width:33.3%;float:text-align:height:50 line-height:50}
+.jedatesety .ymdropul li:hover,.jedatesetm .ymdropul li:hover{background: #ECF4FB;}
+.jedatesety .ymdropul li.action,.jedatesetm .ymdropul li.action{background: #B6E0FA;color:#333;}
+.jedatesety .ymdropul li.action:hover,.jedatesetm .ymdropul li.action:hover{background: #ECF4FB;color:#}
+.jedatetopym p{overflow: padding-top:4}
+.jedatetopym p span{width:31%; margin:0 1.1%;background-color: #d9d9d9;color: #display:height:28line-height:28 border-radius:5text-align:}
+.jedatetopym p span.jedateymchri{background-color: #color: #333;float:font-size: 16}
+.jedatetopym p span.jedateymchle{background-color: #color: #333;float:font-size: 16}
+.jedatetopym p span.jedateymchok{background-color: #color: #333;float:font-size: 12}
+.jedatebox .jedaym{height:202overflow: padding:5}
+.jedatebox .jedaym li{width:50%;float:text-align:height:32 line-height:32}
+.jedatebox .jedaym li.action,.jedatebox .jedaym li.action:hover{background: #B6E0FA;color:#333;}
+.jedatebox .jedaym li:hover{background: #ECF4FB;}
+.jedatebox .jedaol{width:100%;overflow:border-top: 1px solid #}
+.jedatebox .jedaul{ padding:0 4overflow:}
+.jedatebox .jedaol li,.jedatebox .jedaul li{width:14.28%; float: height:30 line-height:30 text-align: position: overflow:}
+.jedatebox .jedaul li{width:14.28%;float:}
+.jedatebox .jedaol li.weeks{background:#f5f5f5;border-bottom: 1px solid #}
+.jedatebox .jedaul li.action,.jedatebox .jedaul li.action:hover{background: #B6E0FA;color:#333;}
+.jedatebox .jedaul li.prevdate,.jedatebox .jedaul li.nextdate{color:#C0D8F3;}
+.jedatebox .jedaul li.disabled{ color:#}
+.jedatebox .jedaul li.disabled:hover{background:#}
+.jedatebox .jedaul li:nth-child(7n){border-right:}
+.jedatebox .jedaul li:hover{background: #ECF4FB;}
+.jedatebox .jedaul li .marks{ width:5 height:5 background:#ff0000; -webkit-border-radius:50%;border-radius:50%; position: right:2 top:4}
+.jedatebox .jedaul li.action .marks{ width:5 height:5 background:# -webkit-border-radius:50%;border-radius:50%; position: right:2 top:4}
+.jedatebot{height:34line-height:34 padding:0 3px 0 5overflow:}
+.jedatebot .botflex{width:50%;float:display: inline-margin:0;padding-top:3 overflow:}
+.jedatebot .botflex li{width:33.33%; float:text-align:}
+.jedatebot .botflex li em{width:70%;float:padding: 0;border:text-align:display:height:26line-height:26}
+.jedatebot .botflex li i{width:30%;float:height:26line-height:24font-style:display:text-align:}
+.jedatebot .jedatebtn{text-align:font-size: 12}
+.jedatebot .jedatebtn span{width:28%;float: margin:0 1.1%;background-color: #color: #333; border:1px #d9d9d9display:height:26line-height:26 border-radius:5text-align:}
+.jedatebot .jedatehms{border:1px #background-color: #margin:0px 5% 3px 0;padding:0 0 0 8display:overflow:}
+/*.jedateh,.jedatems{width: 100%; position:left:0; bottom:40background-color: #border-top: 1px solid #}*/
+.jedateprophms{width: 100%;}
+.jedateproppos{position:left:0; top:0 padding-top:40 display:}
+.jedatepropfix{display:}
+.jedatepropcon{width: 100%; padding-bottom:9background-color: # overflow:border-top: 1px solid #}
+.jedatehmstitle{width:100%;height:30line-height:30background: #f5f5f5; color:#000;border-bottom: 1px solid #position: overflow:text-align:font-size: 15}
+.jedateproptext{width:86 float:height:30line-height:30 text-align:margin-left:10}
+.jedatehmscon{width:84height:140 float: overflow-y:border: 1px solid # margin:0px 0px 0px 10}
+.jedatehmscon p{width:100%;float:text-align:height:28 line-height:28}
+.jedatehmscon p.action{background: #B6E0FA;color:#333;}
+.jedatehmscon p.disabled{ color:#}
+.jedatems p{width:10%;float:text-align:height:32 line-height:32}
+.jedateh p.action,.jedatems p.action{background: #B6E0FA;color:#333;}
+.jedatehmsclose{width:30 height:30 line-height:26 text-align:position:top:50%;right:4 margin-top:-15z-index:150;font-size:24}
+.jedatehmscon::-webkit-scrollbar{height:6width:6margin-right:5background: #f5f5f5;transition:all 0.3s ease-in-border-radius:0px}
+.jedatehmscon::-webkit-scrollbar-track { -webkit-border-radius: 0border-radius: 0}
+.jedatehmscon::-webkit-scrollbar-thumb{-webkit-border-radius: 0border-radius: 0background: rgba(0,0,0,0.5); }
+.jedatehmscon::-webkit-scrollbar-thumb:hover{background:rgba(0,0,0,0.6)}
+.jedatehmscon::-webkit-scrollbar-thumb:active{background:rgba(0,0,0,0.8)}
+.jedatehmscon::-webkit-scrollbar-thumb:window-inactive {background: rgba(0,0,0,0.4);}
Index: jedate.js
===================================================================
--- jedate.js (revision 0)
+++ jedate.js (revision 2)
@@ -0,0 +1,868 @@
+ @Name : jeDate v3.2 日期控件
+ @Author: chen guojun
+ @官网:http://www.jayui.com/jedate/ 或 https://github.com/singod/jeDate
+window.console && (console = console || {log : function(){}});
+;(function(root, factory) {
if (typeof define === &function& && define.amd) {
define([ &jeDate& ], factory);
} else if (typeof exports === &object&) {
module.exports = factory(require(&jeDate&));
root.jeDate = factory(root.jeDate);
+})(this, function(jeDate) {
var jeDt = {}, doc = document, ymdMacth = /\w+|d+/g, oldParseInt = window.parseI
var parseInt = function (n) { return oldParseInt(n, 10); };
// (tag), (#id), (.className) ,(tag & .className) ,(tag & tag) ,(#id & tag.className) , (.className tag) ,(tag, tag, #id) ,(tag#id.className) ,(span & * & b) ,(input[name=radio])
var QD=function(){function r(c,g){g=g||if(!/^[\w\-_#]+$/.test(c)&&g.querySelectorAll)return m(g.querySelectorAll(c));if(-1&c.indexOf(&,&)){for(var d=c.split(/,/g),a=[],b=0,e=d.b&e;++b)a=a.concat(r(d[b],g));return y(a)}var d=c.match(z),a=d.pop(),e=(a.match(t)||k)[1],f=!e&&(a.match(u)||k)[1],b=!e&&(a.match(v)||k)[1],a=c.match(/\[(?:[\w\-_][^=]+)=(?:[\'\[\]\w\-_]+)\]/g);if(f&&!a&&!b&&g.getElementsByClassName)b=m(g.getElementsByClassName(f));else{b=!e&&m(g.getElementsByTagName(b||&*&));f&&(b=w(b,&className&,RegExp(&(^|\\s)&+f+&(\\s|$)&)));if(e)return(d=g.getElementById(e))?[d]:[];if(a)for(e=0;e&a.e++)var f=(a[e].match(x)||k)[1],h=(a[e].match(x)||k)[2],h=h.replace(/\'/g,&&).replace(/\-/g,&\\-&).replace(/\[/g,&\\[&).replace(/\]/g,&\\]&),b=w(b,f,RegExp(&(^&+h+&$)&))}return d[0]&&b[0]?p(d,b):b}function m(c){try{return Array.prototype.slice.call(c)}catch(g){for(var d=[],a=0,b=c.a&b;++a)d[a]=c[a];return d}}function p(c,g,d){var a=c.pop();if(&\x3e&===a)return p(c,g,!0);for(var b=[],e=-1,f=(a.match(t)||k)[1],h=!f&&(a.match(u)||k)[1],a=!f&&(a.match(v)||k)[1],m=-1,q,l,n,a=a&&a.toLowerCase();q=g[++m];){l=q.parentNdo if(n=(n=(n=!a||&*&===a||a===l.nodeName.toLowerCase())&&(!f||l.id===f))&&(!h||RegExp(&(^|\\s)&+h+&(\\s|$)&).test(l.className)),d||n)while(l=l.parentNode);n&&(b[++e]=q)}return c[0]&&b[0]?p(c,b):b}function w(c,g,d){for(var a=-1,b,e=-1,f=[];b=c[++a];)d.test(b.getAttribute(g))&&(f[++e]=b);return f}var z=/(?:[\*\w\-\\.#]+)+(?:\[(?:[\w\-_][^=]+)=(?:[\'\[\]\w\-_]+)\])*|\*|&/gi,u=/^(?:[\w\-_]+)?\.([\w\-_]+)/,t=/^(?:[\w\-_]+)?#([\w\-_]+)/,v=/^([\w\*\-_]+)/,k=[null,null,null],x=/\[([\w\-_][^=]+)=([\'\[\]\w\-_]+)\]/,y=function(){var c=+new Date,g=function(){var d=1;return function(a){var b=a[c],e=d++;return b?!1:(a[c]=e,!0)}}();return function(d){for(var a=d.length,b=[],e=-1,f=0,h;f&a;++f)h=d[f],g(h)&&(b[++e]=h);c+=1;return b}}();return r}();
//判断类型
jeDt.isType = function(obj, type) {
type = type.replace(/\b(\w)|\s(\w)/g, function(m) {
return m.toUpperCase();
return Object.prototype.toString.call(obj) === &[object & + type + &]&;
jeDt.each = function(obj, fn) {
if (jeDt.isType(obj, &array&)) {
for (var i = 0, len = obj. i & i++) {
if (fn.call(obj[i], i, obj[i]) === false)
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
if (fn.call(obj[key], key, obj[key]) === false)
//获取与设置自定义属性
jeDt.attr = function(elem, key, val) {
if (typeof key === &string& && typeof val === &undefined&) {
return elem.getAttribute(key);
elem.setAttribute(key, val);
jeDt.stopmp = function(e) {
e = e || window.
e.stopPropagation ? e.stopPropagation() :e.cancelBubble =
//查询样式是否存在
jeDt.hasClass = function(elem, cls) {
elem = elem || {};
return new RegExp(&\\b& + cls + &\\b&).test(elem.className);
//添加样式
jeDt.addClass = function(elem, cls) {
elem = elem || {};
jeDt.hasClass(elem, cls) || (elem.className += & & + cls);
elem.className = elem.className.replace(/^\s|\s$/g, &&).replace(/\s+/g, & &);
//删除样式
jeDt.removeClass = function(elem, cls) {
elem = elem || {};
if (jeDt.hasClass(elem, cls)) {
elem.className = elem.className.replace(new RegExp(&(\\s|^)& + cls + &(\\s|$)&), &&);
//获取样式
jeDt.getStyle = function(elem, style) {
var cssVal = document.defaultView ? window.getComputedStyle(elem, null)[style] : elem.currentStyle[style];
return cssV
jeDt.isShow = function(elem, bool) {
elem.style.display = bool != true ? &none& :&block&;
//获取与设置HTML
jeDt.html = function(elem, value) {
if (typeof value != &undefined& || value !== undefined && elem.nodeType === 1) {
elem.innerHTML =
return elem.innerHTML;
//获取与设置文本
jeDt.text = function(elem, value) {
if (value !== undefined && elem.nodeType === 1) {
document.all ? elem.innerText = value :elem.textContent =
var emText = document.all ? elem.innerText :elem.textC
return jeDt.trim(emText);
//获取与设置value
jeDt.val = function(elem, value) {
if (value !== undefined && elem.nodeType === 1) {
elem.value =
return jeDt.trim(elem.value);
jeDt.bind = function(elObj, type, fn) {
type = type.toLowerCase();
var bindevent = function (elem) {
elem.attachEvent ? elem.attachEvent(&on& + type, function() {
fn.call(elem, window.type);
}) :elem.addEventListener(type, fn, false);
return elObj == document ? bindevent(document) :jeDt.each(elObj, function(i, elem) {
bindevent(elem);
jeDt.docScroll = function(type) {
type = type ? &scrollLeft& :&scrollTop&;
return doc.body[type] | doc.documentElement[type];
jeDt.winarea = function(type) {
return doc.documentElement[type ? &clientWidth& :&clientHeight&];
//补齐数位
jeDt.digit = function(num) {
return num & 10 ? &0& + (num | 0) :
//转换日期格式
jeDt.parse = function(ymd, hms, format) {
ymd = ymd.concat(hms);
var hmsCheck = jeDt.parseCheck(format, false).substring(0, 5) == &hh:mm&, num = 2;
return format.replace(/YYYY|MM|DD|hh|mm|ss/g, function(str, index) {
var idx = hmsCheck ? ++num :ymd.index = ++ymd.index | 0;
return jeDt.digit(ymd[idx]);
jeDt.parseCheck = function(format, bool) {
var ymdhms = [];
format.replace(/YYYY|MM|DD|hh|mm|ss/g, function(str, index) {
ymdhms.push(str);
return ymdhms.join(bool == true ? &-& :&:&);
jeDt.checkFormat = function(format) {
var ymdhms = [];
format.replace(/YYYY|MM|DD|hh|mm|ss/g, function(str, index) {
ymdhms.push(str);
return ymdhms.join(&-&);
jeDt.parseMatch = function(str) {
var timeArr = str.split(& &);
return timeArr[0].match(ymdMacth);
//验证日期
jeDt.checkDate = function (date) {
var dateArr = date.match(/\w+|d+/g);
if (isNaN(dateArr[0]) || isNaN(dateArr[1]) || isNaN(dateArr[2]))
if (dateArr[1] & 12 || dateArr[1] & 1)
if (dateArr[2] & 1 || dateArr[2] & 31)
if ((dateArr[1] == 4 || dateArr[1] == 6 || dateArr[1] == 9 || dateArr[1] == 11) && dateArr[2] & 30)
if (dateArr[1] == 2) {
if (dateArr[2] & 29)
if ((dateArr[0] % 100 == 0 && dateArr[0] % 400 != 0 || dateArr[0] % 4 != 0) && dateArr[2] & 28)
jeDt.trim = function(text) {
return text.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, &&);
//初始化日期
jeDt.nowDate = function(num, format) {
format = format || 'YYYY-MM-DD hh:mm:ss';
if(typeof num === &string&){
var newDate = new Date(parseInt(num) * 1e3);
num = num | 0;
var newDate = new Date(), todayTime = newDate.getTime() + *24*
newDate.setTime(todayTime);
var years = newDate.getFullYear(), months = newDate.getMonth() + 1, days = newDate.getDate(), hh = newDate.getHours(), mm = newDate.getMinutes(), ss = newDate.getSeconds();
return jeDt.parse([ years, jeDt.digit(months), jeDt.digit(days) ], [ jeDt.digit(hh), jeDt.digit(mm), jeDt.digit(ss) ], format);
jeDt.montharr = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ];
jeDt.weeks = [ &日&, &一&, &二&, &三&, &四&, &五&, &六& ];
//判断元素类型
jeDt.isValHtml = function(that) {
return /textarea|input/.test(that.tagName.toLocaleLowerCase());
jeDt.festival = function(md, n) {
var str = &&;
switch (md) {
case &01.01&: str = &元旦&;
case &02.14&: str = &情人&;
case &03.08&: str = &妇女&;
case &05.01&: str = &劳动&;
case &06.01&: str = &儿童&;
case &08.01&: str = &建军&;
case &09.10&: str = &教师&;
case &10.01&: str = &国庆&;
case &12.24&: str = &平安&;
case &12.25&: str = &圣诞&;
default: str =
var config = {
initAddVal:[0],
format:&YYYY-MM-DD hh:mm:ss&, //日期格式
minDate:& 00:00:00&, //最小日期
maxDate:& 23:59:59&, //最大日期
startMin:jeDt.nowDate(0),
startMax:this.maxDate
jeDt.index = Math.floor(Math.random() * 9e3);
jeDt.boxCell = &#jedatebox&;
jeDt.find = function(tagName){ return QD(jeDt.boxCell + & & +tagName); };
jeDt.isBool = function(obj){
return (obj == undefined || obj == true ?
true : false); };
jeDt.addDateTime = function(time,num,type,format){
var tarr = time.match(ymdMacth), date = new Date(), addNum,
tm0 = parseInt(tarr[0]),
tm1 = tarr[1] == undefined ? date.getMonth() + 1 : parseInt(tarr[1]), tm2 = tarr[2] == undefined ? date.getDate() : parseInt(tarr[2]),
tm3 = tarr[3] == undefined ? date.getHours() : parseInt(tarr[3]), tm4 = tarr[4] == undefined ? date.getMinutes() : parseInt(tarr[4]), tm5 = tarr[5] == undefined ? date.getMinutes() : parseInt(tarr[5]),
newDate = new Date(tm0,jeDt.digit(tm1),jeDt.digit(tm2),jeDt.digit(tm3),jeDt.digit(tm4),jeDt.digit(tm5));
switch (type){
case &DD&: addNum = *24*
case &hh&: addNum = *
case &mm&: addNum = 1000*60*
newDate.setTime(newDate.getTime() + addNum);
return jeDt.parse([ newDate.getFullYear(), newDate.getMonth(), newDate.getDate() ], [ newDate.getHours(), newDate.getMinutes(), newDate.getSeconds() ], format);
//初始化控件
jeDt.initDate = function(opts) {
var even = jeDt.event? jeDt.event: window.event, target, isinitVal = (opts.isinitVal == undefined || opts.isinitVal == false) ? false :
//创建控件骨架外层
var createDiv = function(disCell, self) {
if (QD(self)[0])
jeDt.opts = opts, jeDt.format = opts.format || config.format, minTime = jeDt.opts.minDate || config.minDate, maxTime = jeDt.opts.maxDate || config.maxD
jeDt.fixed = jeDt.isBool(opts.fixed);
if(/\YYYY-MM-DD/.test(jeDt.checkFormat(jeDt.format))){
jeDt.checkDate(minTime) ? jeDt.minDate = minTime : alert(&最小日期不合法&);
jeDt.checkDate(maxTime) ? jeDt.maxDate = maxTime : alert(&最大日期不合法&);
jeDt.minDate = minTime, jeDt.maxDate = maxT
var dateDiv = doc.createElement(&div&), zIndex = opts.zIndex == undefined ? 999 : opts.zI
dateDiv.className = &jedatebox&;
dateDiv.id = jeDt.boxCell.replace(/\#/g,&&);
if(opts.isDisplay) jeDt.attr(dateDiv, &date&, true);
dateDiv.style.cssText = &z-index:& + zIndex + &;position:& + (jeDt.fixed == true ? &absolute& :&fixed&) + &;display:&;
disCell.appendChild(dateDiv);
}, initVals = function(elem) {
var jeformat = opts.format || config.format, inaddVal = opts.initAddVal || config.initAddVal, num,
if(inaddVal.length == 1){
num = inaddVal[0], type = &DD&;
num = inaddVal[0], type = inaddVal[1];
var nowDateVal = jeDt.nowDate(0, jeformat), jeaddDate = jeDt.addDateTime(nowDateVal, num, type, jeformat);
(jeDt.val(elem) || jeDt.text(elem)) == && ? jeDt.isValHtml(elem) ? jeDt.val(elem, jeaddDate) :jeDt.text(elem, jeaddDate) :jeDt.isValHtml(elem) ? jeDt.val(elem) : jeDt.text(elem);
//为开启初始化的时间设置值
if (isinitVal) {
jeDt.each(QD(&body &+ opts.dateCell), function(i, elem) {
initVals(elem);
if (even) {
jeDt.stopmp(even);
createDiv(doc.body, jeDt.boxCell);
jeDt.elemCell = typeof (opts.dateCell) == &string& ? QD(opts.dateCell)[0] : opts.dateC
jeDt.setHtml();
jeDt.bind(QD(opts.dateCell), &click&, function (ev) {
jeDt.stopmp(ev);
createDiv(doc.body, jeDt.boxCell);
jeDt.elemCell =
jeDt.setHtml();
//方位辨别
jeDt.orien = function(obj, self, pos) {
var tops, leris, ortop, orleri, rect = jeDt.fixed ? self.getBoundingClientRect() : obj.getBoundingClientRect();
if(jeDt.fixed) {
leris = rect.right + obj.offsetWidth / 1.5 &= jeDt.winarea(1) ? rect.right - obj.offsetWidth : rect.left + (pos ? 0 : jeDt.docScroll(1));
tops = rect.bottom + obj.offsetHeight / 1 &= jeDt.winarea() ? rect.bottom - 1 : rect.top & obj.offsetHeight / 1.5 ? rect.top - obj.offsetHeight - 1 : jeDt.winarea() - obj.offsetH
ortop = Math.max(tops + (pos ? 0 :jeDt.docScroll()) + 1, 1) + &px&, orleri = leris + &px&;
ortop = &50%&, orleri = &50%&;
obj.style.marginTop = -(rect.height / 2) + &px&;
obj.style.marginLeft = -(rect.width / 2) + &px&;
obj.style.top =
obj.style.left =
//布局控件骨架
jeDt.setHtml = function() {
var weekHtml = &&, tmsArr = &&, date = new Date(),
dateFormat = jeDt.checkFormat(jeDt.format),
isYYMM = (dateFormat == &YYYY-MM& || dateFormat == &YYYY&) ? true :false,
ishhmm = dateFormat.substring(0, 5) == &hh-mm& ? true :
if ((jeDt.val(jeDt.elemCell) || jeDt.text(jeDt.elemCell)) == &&) {
jeDt.currDate =
tmsArr = [ date.getFullYear(), date.getMonth() + 1, date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds() ];
jeDt.ymdDate = tmsArr[0] + &-& + jeDt.digit(tmsArr[1]) + &-& + jeDt.digit(tmsArr[2]);
var initVal = jeDt.isValHtml(jeDt.elemCell) ? jeDt.val(jeDt.elemCell) : jeDt.text(jeDt.elemCell),
inVals = initVal.match(ymdMacth);
if(ishhmm){
tmsArr = dateFormat == &hh-mm& ? [ inVals[0], inVals[1], date.getSeconds() ] :[ inVals[0], inVals[1], inVals[2] ];
jeDt.currDate = new Date(date.getFullYear(), date.getMonth(), date.getDate());
tmsArr = [ inVals[0], inVals[1], inVals[2], inVals[3], inVals[4], inVals[5] == undefined ? date.getSeconds() :inVals[5] ];
jeDt.currDate = new Date(inVals[0], inVals[1], inVals[2]);
jeDt.ymdDate = tmsArr[0] + &-& + jeDt.digit(tmsArr[1]) + &-& + jeDt.digit(tmsArr[2]);
if(!ishhmm) jeDt.currMonth = (jeDt.val(jeDt.elemCell) || jeDt.text(jeDt.elemCell)) == && ? jeDt.currDate.getMonth() : jeDt.currDate.getMonth() - 1;
//控件HMTL模板
var datetopStr = '&div class=&jedatetop&&' + (!isYYMM ? '&div class=&jedateym& style=&width:50%;&&&i class=&prev triangle yearprev&&&/i&&span class=&jedateyy& ym=&24&&&em class=&jedateyear&&&/em&&em class=&pndrop&&&/em&&/span&&i class=&next triangle yearnext&&&/i&&/div&' + '&div class=&jedateym& style=&width:50%;&&&i class=&prev triangle monthprev&&&/i&&span class=&jedatemm& ym=&12&&&em class=&jedatemonth&&&/em&&em class=&pndrop&&&/em&&/span&&i class=&next triangle monthnext&&&/i&&/div&' :'&div class=&jedateym& style=&width:100%;&&&i class=&prev triangle ymprev&&&/i&&span class=&jedateyy&&&em class=&jedateyearmonth&&&/em&&/span&&i class=&next triangle ymnext&&&/i&&/div&') + &&/div&&;
var dateymList = !isYYMM ? '&div class=&jedatetopym& style=&display:&&' + '&ul class=&ymdropul&&&/ul&&p&&span class=&jedateymchle&&←&/span&&span class=&jedateymchri&&→&/span&&span class=&jedateymchok&&关闭&/span&&/p&' + &&/div&& :(dateFormat == &YYYY& ? '&ul class=&jedayy&&&/ul&' : '&ul class=&jedaym&&&/ul&');
var dateriList = '&ol class=&jedaol&&&/ol&&ul class=&jedaul&&&/ul&';
var bothmsStr = !isYYMM ? '&div class=&botflex jedatehmsshde&&&ul class=&jedatehms&&&li&&input type=&text& /&&/li&&i&:&/i&&li&&input type=&text& /&&/li&&i&:&/i&&li&&input type=&text& /&&/li&&/ul&&/div&' + '&div class=&botflex jedatebtn&&&span class=&jedateok&&确认&/span&&span class=&jedatetodaymonth&&今天&/span&&span class=&jedateclear&&清空&/span&&/div&' :(dateFormat == &YYYY& ? '&div class=&botflex jedatebtn&&&span class=&jedateok& style=&width:47.8%&&确认&/span&&span class=&jedateclear& style=&width:47.8%&&清空&/span&&/div&' : '&div class=&botflex jedatebtn&&&span class=&jedateok&&确认&/span&&span class=&jedatetodaymonth&&本月&/span&&span class=&jedateclear&&清空&/span&&/div&');
var datebotStr = '&div class=&jedatebot&&' + bothmsStr + &&/div&&;
var datehmschoose = '&div class=&jedateprophms ' + (ishhmm ? &jedatepropfix& :&jedateproppos&) + '&&&div class=&jedatepropcon&&&div class=&jedatehmstitle&&时间选择&div class=&jedatehmsclose&&&&/div&&/div&&div class=&jedateproptext&&小时&/div&&div class=&jedateproptext&&分钟&/div&&div class=&jedateproptext&&秒数&/div&&div class=&jedatehmscon jedateprophours&&&/div&&div class=&jedatehmscon jedatepropminutes&&&/div&&div class=&jedatehmscon jedatepropseconds&&&/div&&/div&&/div&';
var dateHtmStr = isYYMM ? datetopStr + dateymList + datebotStr :ishhmm ? datetopStr + datehmschoose + datebotStr :datetopStr + dateymList + dateriList + datehmschoose + datebotS
jeDt.html(QD(jeDt.boxCell)[0], dateHtmStr);
//是否显示清除按钮
jeDt.isBool(jeDt.opts.isClear) ? && : jeDt.isShow(jeDt.find(&.jedatebot .jedateclear&)[0], false);
//是否显示今天按钮
if(!isYYMM){
jeDt.isBool(jeDt.opts.isToday) ? && : jeDt.isShow(jeDt.find(&.jedatebot .jedatetodaymonth&)[0], false);
//判断是否有时分秒
if(/\hh-mm/.test(dateFormat)){
var isTimehms = function(bool) {
if(jeDt.val(jeDt.elemCell) != && || jeDt.text(jeDt.elemCell) != &&) {
var hmsArrs = bool ? [ tmsArr[0], tmsArr[1], tmsArr[2] ] : [ tmsArr[3], tmsArr[4], tmsArr[5] ];
var hmsArrs =
[ jeDt.currDate.getHours(), jeDt.currDate.getMinutes(), jeDt.currDate.getSeconds() ];
jeDt.each(jeDt.find(&.jedatebot .jedatehms input&), function(i, cls) {
jeDt.val(cls, jeDt.digit(hmsArrs[i]));
jeDt.isBool(jeDt.opts.ishmsVal) ? && : jeDt.attr(cls, &readOnly&,'true');
if(ishhmm){
isTimehms(true);
jeDt.text(jeDt.find(&.jedateyear&)[0], jeDt.currDate.getFullYear() + '年').text(jeDt.find(&.jedatemonth&)[0], jeDt.digit(jeDt.currDate.getMonth() + 1) + '月');
if(jeDt.isBool(jeDt.opts.isTime)){
isTimehms(false);
jeDt.isShow(jeDt.find(&.jedatebot .jedatehmsshde&)[0], false);
jeDt.find(&.jedatebot .jedatebtn&)[0].style.width = &100%&;
if (!isYYMM) jeDt.isShow(jeDt.find(&.jedatebot .jedatehmsshde&)[0], false);
jeDt.find(&.jedatebot .jedatebtn&)[0].style.width = &100%&;
//判断是否为年月类型
if(/\YYYY-MM-DD/.test(dateFormat)){
jeDt.each(jeDt.weeks, function(i, week) {
weekHtml += '&li class=&weeks& data-week=&' + week + '&&' + week + &&/li&&;
jeDt.each(jeDt.find(&.jedaol&), function(i, elem) {
jeDt.html(elem, weekHtml);
jeDt.getDateStr(jeDt.currDate.getFullYear(), jeDt.currMonth);
jeDt.chooseYM();
if(isYYMM){
var monthCls = jeDt.find(&.jedateym .jedateyearmonth&)[0];
if(dateFormat == &YYYY&){
jeDt.attr(monthCls, &data-onyy&,tmsArr[0]);
jeDt.text(monthCls, tmsArr[0] + &年&);
jeDt.html(jeDt.find(&.jedayy&)[0], jeDt.onlyYear(tmsArr[0]));
jeDt.attr(monthCls, &data-onym&,tmsArr[0]+&-&+jeDt.digit(tmsArr[1]));
jeDt.text(monthCls, tmsArr[0] + &年& + jeDt.digit(tmsArr[1]) + &月&);
jeDt.html(jeDt.find(&.jedaym&)[0], jeDt.onlyYMStr(tmsArr[0], tmsArr[1]));
jeDt.onlyYMevents(tmsArr);
jeDt.orien(QD(jeDt.boxCell)[0], jeDt.elemCell);
setTimeout(function () {
jeDt.opts.success && jeDt.opts.success(jeDt.elemCell);
jeDt.events(tmsArr);
//循环生成年月(YYYY-MM)
jeDt.onlyYMStr = function(y, m) {
var onlyYM = &&;
jeDt.each(jeDt.montharr, function(i, val) {
var minArr = jeDt.parseMatch(jeDt.minDate), maxArr = jeDt.parseMatch(jeDt.maxDate),
thisDate = new Date(y, jeDt.digit(val), &01&), minTime = new Date(minArr[0], minArr[1], minArr[2]), maxTime = new Date(maxArr[0], maxArr[1], maxArr[2]);
if (thisDate & minTime || thisDate & maxTime) {
onlyYM += &&li class='disabled' ym='& + y + &-& + jeDt.digit(val) + &'&& + y + &年& + jeDt.digit(val) + &月&/li&&;
onlyYM += &&li & + (m == val ? 'class=&action&' :&&) + ' ym=&' + y + &-& + jeDt.digit(val) + '&&' + y + &年& + jeDt.digit(val) + &月&/li&&;
return onlyYM;
//循环生成年(YYYY)
jeDt.onlyYear = function(YY) {
var onlyStr = &&;
jeDt.yearArr = new Array(15);
jeDt.each(jeDt.yearArr, function(i) {
var minArr = jeDt.parseMatch(jeDt.minDate), maxArr = jeDt.parseMatch(jeDt.maxDate),
minTime = minArr[0], maxTime = maxArr[0], yyi = YY - 7 + i,
getyear = jeDt.attr(jeDt.find(&.jedateym .jedateyearmonth&)[0], &data-onyy&);
if (yyi & minTime || yyi & maxTime) {
onlyStr += &&li class='disabled' yy='& + yyi + &'&& + yyi + &年&/li&&;
onlyStr += &&li &+(getyear == yyi ? 'class=&action&' : &&)+& yy='& + yyi + &'&& + yyi + &年&/li&&;
return onlyS
//仅年月情况下的点击
jeDt.onlyYMevents = function(tmsArr) {
var ymVal, ymPre = jeDt.find(&.jedateym .ymprev&), ymNext = jeDt.find(&.jedateym .ymnext&), ony = parseInt(tmsArr[0]), onm = parseFloat(tmsArr[1]);
jeDt.each([ ymPre, ymNext ], function(i, cls) {
jeDt.bind(cls, &click&, function(ev) {
jeDt.stopmp(ev);
if(jeDt.checkFormat(jeDt.format) == &YYYY&){
ymVal = cls == ymPre ? jeDt.attr(jeDt.find(&.jedayy li&)[0], &yy&) : jeDt.attr(jeDt.find(&.jedayy li&)[jeDt.yearArr.length-1], &yy&);
jeDt.html(jeDt.find(&.jedayy&)[0], jeDt.onlyYear(parseInt(ymVal)));
ymVal = cls == ymPre ? ony -= 1 :ony += 1;
jeDt.html(jeDt.find(&.jedaym&)[0], jeDt.onlyYMStr(ymVal, onm));
jeDt.ymPremNextEvents();
//循环生成日历
jeDt.getDateStr = function(y, m) {
var minArr = jeDt.minDate.match(/\w+|d+/g), minNum = minArr[0] + minArr[1] + minArr[2], maxArr = jeDt.maxDate.match(/\w+|d+/g), maxNum = maxArr[0] + maxArr[1] + maxArr[2];
jeDt.html(jeDt.find(&.jedaul&)[0], &&); //切忌一定要把这个内容去掉,要不然会点一次翻页都在日历下面依次显示出来
var activeDate = new Date(y, m, 1); //外面传进来的不断变化的日期对象
var year = activeDate.getFullYear(), month = activeDate.getMonth(); //把当前的月份保存下来只是为了给title获取月份
jeDt.attr(jeDt.find(&.jedateyear&)[0], &year&, month & 11 ? year + 1 : year), jeDt.text(jeDt.find(&.jedateyear&)[0], (month & 11 ? year + 1 : year) + '年');
jeDt.attr(jeDt.find(&.jedatemonth&)[0], &month&, jeDt.digit(month + 1)), jeDt.text(jeDt.find(&.jedatemonth&)[0], jeDt.digit(month + 1) + '月');
//设置时间标注
var mark = function (my, mm, md) {
var Marks = jeDt.opts.marks, contains = function(arr, obj) {
var len = arr.
while (len--) {
if (arr[len] === obj)
return jeDt.isType(Marks, &array&) && Marks.length & 0 && contains(Marks, my + &-& + mm + &-& + md) ? '&i class=&marks&&&/i&' :&&;
//是否显示节日
var isfestival = function(day, n) {
return jeDt.opts.festival ? jeDt.festival(day, n) :n;
//创建日历上面的日期行数
var line = 1 - activeDate.getDay();
if (line == 1) line = -6; //为了日历更友好的显示三个月,让用户看的更明白。
activeDate.setDate(line); //如果n为负数,则减少月份.在用这个月最后一天减去这个值就可以获得日历从哪天开始的。
for (var i = 0; i & 42; i++) {
var cLis = document.createElement('li');
var actYear = activeDate.getFullYear(), actMonth = activeDate.getMonth(), actDays = activeDate.getDate(), //返回日期1-31号
newMonth = month & actMonth ? 0 == actMonth ? 1 : month : actMonth == month ? month + 1 : 11 == actMonth ? 12 : month + 2,
newYear = actYear == year ? year : actYear & year ? year + 1 : year - 1;
jeDt.find(&.jedaul&)[0].appendChild(cLis);
jeDt.html(cLis, isfestival(jeDt.digit(newMonth) + &.& + jeDt.digit(actDays), jeDt.digit(actDays)) + mark(newYear,jeDt.digit(newMonth),jeDt.digit(actDays)));
jeDt.attr(cLis, &year&, newYear).attr(cLis, &month&, jeDt.digit(newMonth)).attr(cLis, &day&, jeDt.digit(actDays));
//这里必须是 actMonth + 1 ,不能用m+1。因为这个是一直变化的。要不然日历不管点哪天都是属于当前月份的。
cLis.dateVals = year + &-& + jeDt.digit(actMonth + 1) + &-& + jeDt.digit(actDays);
var thatNum = (newYear + &-& + jeDt.digit(newMonth) + &-& + jeDt.digit(actDays)).replace(/\-/g, ''),
newOne = newYear + &-& + jeDt.digit(newMonth) + &-& + jeDt.digit(1), actOne = year + &-& + jeDt.digit(actMonth + 1) + &-& + jeDt.digit(1);
if (actMonth != month) {
jeDt.addClass(cLis, &other&); //不是本月的天数颜色变成浅色
//判断是否在限制的日期之中,如果在限制中可以选择
if (parseInt(thatNum) &= parseInt(minNum) && parseInt(thatNum) &= parseInt(maxNum) && actMonth == month) {
if ((jeDt.val(jeDt.elemCell) || jeDt.text(jeDt.elemCell)) == &&) {
var thatOne = jeDt.currDate.getFullYear() + &-& + jeDt.digit(jeDt.currDate.getMonth() + 1) + &-& + jeDt.digit(1);
if (jeDt.ymdDate == cLis.dateVals && (jeDt.currDate.getMonth() + 1 == actMonth + 1)) {
jeDt.addClass(cLis, &action&);
} else if (thatOne != actOne) {
if (newOne == cLis.dateVals) jeDt.addClass(cLis, &action&);
var thisOne = jeDt.currDate.getFullYear() + &-& + jeDt.digit(jeDt.currDate.getMonth()) + &-& + jeDt.digit(1);
if (jeDt.ymdDate == cLis.dateVals && (jeDt.currDate.getMonth() == actMonth + 1)) {
jeDt.addClass(cLis, &action&);
} else if (thisOne != actOne) {
if (newOne == cLis.dateVals) jeDt.addClass(cLis, &action&);
if (parseInt(minNum) & parseInt(thatNum) || parseInt(maxNum) & parseInt(thatNum)) {
jeDt.addClass(cLis, &disabled&);
//切忌下面这个增加天数语句,一定要判断完上面是不是本月的天数,然后在添加这条增加语句,要不然会出现错误。
activeDate.setDate(actDays + 1); //如果超出该月份应有的天数则增加月份
jeDt.chooseDays();
//选择日期
jeDt.chooseDays = function() {
jeDt.bind(jeDt.find(&.jedaul li&), &click&, function(ev) {
var that = this, liTms = [], valcell = jeDt.elemC
if (jeDt.hasClass(that, &disabled&))
jeDt.stopmp(ev);
jeDt.each(jeDt.find(&.jedatehms input&), function(i, val) {
liTms.push(jeDt.val(val));
var aty = parseInt(jeDt.attr(that, &year&)), atm = parseFloat(jeDt.attr(that, &month&)), atd = parseFloat(jeDt.attr(that, &day&)),
getDateVal = jeDt.parse([ aty, atm, atd ], [ liTms[0], liTms[1], liTms[2] ], jeDt.format);
jeDt.isValHtml(valcell) ? jeDt.val(valcell, getDateVal) :jeDt.text(valcell, getDateVal);
jeDt.dateClose();
if (jeDt.isType(jeDt.opts.choosefun, &function&) || jeDt.opts.choosefun != null) jeDt.opts.choosefun&&jeDt.opts.choosefun(jeDt.elemCell,getDateVal);
//生成定位时分秒
jeDt.setStrhms = function() {
var parseFormat = jeDt.format, hmsArr = [], hmsliCls = jeDt.find(&.jedatehms li&),
proptextCls = jeDt.find(&.jedatepropcon .jedateproptext&), propconCls = jeDt.find(&.jedatepropcon .jedatehmscon&);
var parsehms = function(str) {
var ymdstr = str.match(ymdMacth).join(&-&), timeArr = ymdstr == &YYYY-MM-DD-hh-mm& ? str.split(& &) : ymdstr,
isHMtime = ymdstr == &YYYY-MM-DD-hh-mm& ? timeArr[1] :timeA
return isHMtime.match(ymdMacth).join(&-&);
var parmathm = parsehms(parseFormat) == &hh-mm&;
if(parmathm){
var hmsliWidth = jeDt.getStyle(hmsliCls[0],'width').replace(/\px|em|rem/g,''), hmsiW = jeDt.getStyle(jeDt.find(&.jedatehms i&)[0],'width').replace(/\px|em|rem/g,''),
hmschoseW = jeDt.getStyle(proptextCls[0],'width').replace(/\px|em|rem/g,''), hmslival = Math.round(parseInt(hmsliWidth) + parseInt(hmsliWidth)/2 + parseInt(hmsiW)/2);
hmsliCls[0].style.width = hmsliCls[1].style.width = hmslival + &px&;
proptextCls[0].style.width = proptextCls[1].style.width = propconCls[0].style.width = propconCls[1].style.width = Math.round(parseInt(hmschoseW) + parseInt(hmschoseW)/2 + 2) + &px&;
//生成时分秒
jeDt.each([ 24, 60, 60 ], function(i, len) {
var hmsStr = &&, hmsCls = &&, inputCls = jeDt.find(&.jedatehms input&), textem = jeDt.val(inputCls[i]);
jeDt.attr(inputCls[i],&maxlength&,2).attr(inputCls[i],&numval&,len-1).attr(inputCls[i],&item&,i);
for (var h = 0; h & h++) {
h = jeDt.digit(h);
if (jeDt.opts.ishmsLimit) {
hmsCls = h & textem ? &disabled& :h == textem ? &action& :&&;
hmsCls = parmathm && i == 2 ? textem == h ? &disabled action& :&disabled& :textem == h ? &action& :&&;
if(parmathm && i == 2){
var readCls = hmsliCls[2];
readCls.style.display = readCls.previousSibling.style.display = &none&;
proptextCls[i].style.display = propconCls[i].style.display = &none&;
hmsStr += '&p class=&' + hmsCls + '&&' + h + &&/p&&;
hmsArr.push(hmsStr);
return hmsA
jeDt.dateClose = function() {
doc.body.removeChild(QD(jeDt.boxCell)[0]);
//下拉选择年和月
jeDt.chooseYM = function() {
var jetopym = jeDt.find(&.jedatetopym&), jedateyy = jeDt.find(&.jedateyy&), jedatemm = jeDt.find(&.jedatemm&), jedateyear = jeDt.find(&.jedateyy .jedateyear&),
jedatemonth = jeDt.find(&.jedatemm .jedatemonth&), mchri = jeDt.find(&.jedateymchri&), mchle = jeDt.find(&.jedateymchle&),
ishhmmss = jeDt.checkFormat(jeDt.format).substring(0, 5) == &hh-mm& ? true :
//循环生成年
function eachYears(YY) {
var eachStr = &&;
jeDt.each(new Array(15), function(i) {
if (i === 7) {
var getyear = jeDt.attr(jedateyear[0], &year&);
eachStr += &&li & + (getyear == YY ? 'class=&action&' :&&) + ' yy=&' + YY + '&&' + YY + &年&/li&&;
eachStr += '&li yy=&' + (YY - 7 + i) + '&&' + (YY - 7 + i) + &年&/li&&;
return eachS
//循环生成月
function eachYearMonth(YY, ymlen) {
var ymStr = &&;
if (ymlen == 12) {
jeDt.each(jeDt.montharr, function(i, val) {
var getmonth = jeDt.attr(jedatemonth[0], &month&), val = jeDt.digit(val);
ymStr += &&li & + (getmonth == val ? 'class=&action&' :&&) + ' mm=&' + val + '&&' + val + &月&/li&&;
jeDt.each([ mchri, mchle ], function(c, cls) {
jeDt.isShow(cls[0], false);
ymStr = eachYears(YY);
jeDt.each([ mchri, mchle ], function(c, cls) {
jeDt.isShow(cls[0], true);
jeDt.removeClass(jetopym[0], ymlen == 12 ? &jedatesety& :&jedatesetm&).addClass(jetopym[0], ymlen == 12 ? &jedatesetm& :&jedatesety&);
jeDt.html(jeDt.find(&.jedatetopym .ymdropul&)[0], ymStr);
jeDt.isShow(jetopym[0], true);
function clickLiYears(year) {
jeDt.bind(jeDt.find(&.ymdropul li&), &click&, function(ev) {
var Years = jeDt.attr(this, &yy&), Months = parseInt(jeDt.attr(jedatemonth[0], &month&)) - 1;
jeDt.attr(year, &year&, Years);
jeDt.html(year, Years + '年');
jeDt.isShow(jetopym[0], false);
jeDt.getDateStr(Years, Months);
//下拉选择年
!ishhmmss && jeDt.bind(jedateyy, &click&, function() {
var YMlen = parseInt(jeDt.attr(this, &ym&)), yearAttr = parseInt(jeDt.attr(jedateyear[0], &year&));
eachYearMonth(yearAttr, YMlen);
clickLiYears(jedateyear[0]);
//下拉选择月
!ishhmmss && jeDt.bind(jedatemm, &click&, function() {
var YMlen = parseInt(jeDt.attr(this, &ym&)), yearAttr = parseInt(jeDt.attr(jedateyear[0], &year&));
eachYearMonth(yearAttr, YMlen);
jeDt.bind(jeDt.find(&.ymdropul li&), &click&, function(ev) {
var Years = jeDt.attr(jedateyear[0], &year&), Months = parseInt(jeDt.attr(this, &mm&)) - 1;
jeDt.attr(jedatemonth[0], &month&, Months);
jeDt.html(jedatemonth[0], Months + '月');
jeDt.isShow(jetopym[0], false);
jeDt.getDateStr(Years, Months);
//关闭下拉选择
jeDt.bind(jeDt.find(&.jedateymchok&), &click&, function(ev) {
jeDt.stopmp(ev);
jeDt.isShow(jetopym[0], false);
var yearMch = parseInt(jeDt.attr(jedateyear[0], &year&));
jeDt.each([ mchle, mchri ], function(d, cls) {
jeDt.bind(cls, &click&, function(ev) {
jeDt.stopmp(ev);
d == 0 ? yearMch -= 15 :yearMch += 15;
var mchStr = eachYears(yearMch);
jeDt.html(jeDt.find(&.jedatetopym .ymdropul&)[0], mchStr);
clickLiYears(jedateyear[0]);
//年月情况下的事件绑定
jeDt.ymPremNextEvents = function(){
var newDate = new Date(), valcell = jeDt.elemCell, isYY = (jeDt.checkFormat(jeDt.format) == &YYYY&), ymCls = isYY ? jeDt.find(&.jedayy li&) : jeDt.find(&.jedaym li&);
//选择年月
jeDt.bind(ymCls, &click&, function (ev) {
var that =
if (jeDt.hasClass(that, &disabled&))
//判断是否为禁选状态
jeDt.stopmp(ev);
var atYM =
isYY ? jeDt.attr(that, &yy&).match(/\w+|d+/g) : jeDt.attr(that, &ym&).match(/\w+|d+/g),
getYMDate = isYY ? jeDt.parse([atYM[0], newDate.getMonth() + 1, 1], [0, 0, 0], jeDt.format) : jeDt.parse([atYM[0], atYM[1], 1], [0, 0, 0], jeDt.format);
jeDt.isValHtml(valcell) ? jeDt.val(valcell, getYMDate) : jeDt.text(valcell, getYMDate);
jeDt.dateClose();
if (jeDt.isType(jeDt.opts.choosefun, &function&) || jeDt.opts.choosefun != null) jeDt.opts.choosefun(jeDt.elemCell, getYMDate);
//各种事件绑定
jeDt.events = function(tmsArr) {
var newDate = new Date(), yPre = jeDt.find(&.yearprev&), yNext = jeDt.find(&.yearnext&),
mPre = jeDt.find(&.monthprev&), mNext = jeDt.find(&.monthnext&),
jedateyear = jeDt.find(&.jedateyear&), jedatemonth = jeDt.find(&.jedatemonth&),
isYYMM = (jeDt.checkFormat(jeDt.format) == &YYYY-MM& || jeDt.checkFormat(jeDt.format) == &YYYY&) ? true :false,
ishhmmss = jeDt.checkFormat(jeDt.format).substring(0, 5) == &hh-mm& ? true :
if (!isYYMM) {
!ishhmmss && jeDt.each([ yPre, yNext ], function(i, cls) {
jeDt.bind(cls, &click&, function(ev) {
jeDt.stopmp(ev);
var year = parseInt(jeDt.attr(jeDt.find(&.jedateyear&)[0], &year&));
cls == yPre ? jeDt.getDateStr(--year, jeDt.currMonth) : jeDt.getDateStr(++year, jeDt.currMonth);
!ishhmmss && jeDt.each([ mPre, mNext ], function(i, cls) {
jeDt.bind(cls, &click&, function(ev) {
jeDt.stopmp(ev);
var year = parseInt(jeDt.currDate.getFullYear());
cls == mPre ?jeDt.getDateStr(year, --jeDt.currMonth) : jeDt.getDateStr(year, ++jeDt.currMonth);
//时分秒事件绑定
var hmsStr = jeDt.setStrhms(), hmsevents = function(hmsArr) {
jeDt.each(hmsArr, function(i, hmsCls) {
if (jeDt.html(hmsCls[0]) == &&) jeDt.html(hmsCls[0], hmsStr[i]);
if (ishhmmss) {
jeDt.isShow(jeDt.find(&.jedatehmsclose&)[0], false);
jeDt.isShow(jeDt.find(&.jedatetodaymonth&)[0], false);
jeDt.isShow(jeDt.find(&.jedateprophms&)[0], true);
//计算当前时分秒的位置
jeDt.each([ &hours&, &minutes&, &seconds& ], function(i, hms) {
var hmsCls = jeDt.find(&.jedateprop& + hms), achmsCls = jeDt.find(&.jedateprop&+hms+& .action&);
hmsCls[0].scrollTop = achmsCls[0].offsetTop - 118;
var onhmsPCls = jeDt.find(&.jedateprop& + hms + & p&);
jeDt.bind(onhmsPCls, &click&, function() {
var that =
if (jeDt.hasClass(that, &disabled&))
jeDt.each(onhmsPCls, function(j, cls) {
jeDt.removeClass(cls, &action&);
jeDt.addClass(that, &action&);
jeDt.val(jeDt.find(&.jedatebot .jedatehms input&)[i], jeDt.digit(jeDt.text(that)));
if (!ishhmmss) jeDt.isShow(jeDt.find(&.jedateprophms&)[0], false);
var hs = jeDt.find(&.jedateprophours&), ms = jeDt.find(&.jedatepropminutes&), ss = jeDt.find(&.jedatepropseconds&);
if (ishhmmss) {
hmsevents([ hs, ms, ss ]);
jeDt.bind(jeDt.find(&.jedatehms&), &click&, function() {
if (jeDt.find(&.jedateprophms&)[0].style.display !== &block&) hmsevents([ hs, ms, ss ]);
//关闭时分秒层
jeDt.bind(jeDt.find(&.jedateprophms .jedatehmsclose&), &click&, function() {
jeDt.isShow(jeDt.find(&.jedateprophms&)[0], false);
//今天按钮设置日期时间
jeDt.bind(jeDt.find(&.jedatebot .jedatetodaymonth&), &click&, function() {
var toTime = [ newDate.getFullYear(), newDate.getMonth() + 1, newDate.getDate(), newDate.getHours(), newDate.getMinutes(), newDate.getSeconds() ],
gettoDate = jeDt.parse([ toTime[0], toTime[1], toTime[2] ], [ toTime[3], toTime[4], toTime[5] ], jeDt.format),
valcell = jeDt.elemC
jeDt.getDateStr(toTime[0], toTime[1], toTime[2]);
jeDt.isValHtml(valcell) ? jeDt.val(valcell, gettoDate) :jeDt.text(valcell, gettoDate);
jeDt.dateClose();
if (jeDt.isType(jeDt.opts.choosefun, &function&) || jeDt.opts.choosefun != null) jeDt.opts.choosefun(jeDt.elemCell,gettoDate);
if (!isYYMM) jeDt.chooseDays();
var valcell = jeDt.elemC
jeDt.ymPremNextEvents();
//本月按钮设置日期时间
jeDt.bind(jeDt.find(&.jedatebot .jedatetodaymonth&), &click&, function(ev) {
jeDt.stopmp(ev);
var ymTime = [ newDate.getFullYear(), newDate.getMonth() + 1, newDate.getDate() ],
YMDate = jeDt.parse([ ymTime[0], ymTime[1], 0 ], [ 0, 0, 0 ], jeDt.format);
jeDt.isValHtml(valcell) ? jeDt.val(valcell, YMDate) :jeDt.text(valcell, YMDate);
jeDt.dateClose();
if (jeDt.isType}

我要回帖

更多关于 yyyy mm dd hh mm 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信