代码拉取完成,页面将自动刷新
同步操作将从 笔心/jquery.datepicker 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
(function(e){var t='<div class="datepicker" id="datepicker"> <div class="top"> <div class="datepicker-select datepicker-select-year"> <div class="datepicker-select-selected"></div> <ul class="datepicker-select-option"> {{yearRange}} </ul> </div> <div class="datepicker-select datepicker-select-month"> <div class="datepicker-select-selected"></div> <ul class="datepicker-select-option"> <li data-month="1"> 1月</li> <li data-month="2"> 2月</li> <li data-month="3"> 3月</li> <li data-month="4"> 4月</li> <li data-month="5"> 5月</li> <li data-month="6"> 6月</li> <li data-month="7"> 7月</li> <li data-month="8"> 8月</li> <li data-month="9"> 9月</li> <li data-month="10">10月</li> <li data-month="11">11月</li> <li data-month="12">12月</li> </ul> </div> </div> <table class="body"> <thead> <tr> <td class="cell week-cell">一</td> <td class="cell week-cell">二</td> <td class="cell week-cell">三</td> <td class="cell week-cell">四</td> <td class="cell week-cell">五</td> <td class="cell week-cell">六</td> <td class="cell week-cell">日</td> </tr> </thead> <tbody> </tbody> </table> <div class="bottom"> <div class="btn-clear">清空</div> </div> </div>';t=t.replace("{{yearRange}}",c());var a=e(t).appendTo(document.body);a.on("click",".datepicker-select",function(){var t=e(this).find(".datepicker-select-option");if(t.is(":hidden")){t.show()}else{t.hide()}}).on("click",".datepicker-select-option li",function(){var t=e(this).data("year")||e(".datepicker-select-year .datepicker-select-selected").data("year");var a=e(this).data("month")||e(".datepicker-select-month .datepicker-select-selected").data("month");l(t,a)}).on("mouseleave",".datepicker-select",function(){e(this).find(".datepicker-select-option").hide()}).on("click",".curr-month,.prev-month,.next-month",function(){a.find(".selected").removeClass("selected");e(this).addClass("selected");var t=e(this).data("value");var l=t.split("-");a._value={year:l[0]-0,month:l[1]-0,day:l[2]-0};a._bind.val(t);a.hide()}).on("click",".btn-clear",function(){a._bind.val("");a.hide()});e(document).on("mouseup",function(t){var l=e(t.target);if(a._instance){if(l.closest(".datepicker").length==0&&!l.is(a._bind)){a.hide()}}});function l(e,t){var l=[];var c=new Date(e,t-1,1);var s=c.getDay();if(s==0){s=7}if(s>1){c=new Date(e,t-1,0);var n=c.getDate();for(var r=s-2;r>=0;r--){l.push({value:d(c.getFullYear(),c.getMonth()+1,n-r),date:n-r,"class":"prev-month"})}}c=new Date(e,t,0);for(var r=1,o=c.getDate();r<=o;r++){l.push({value:d(e,t,r),date:r,"class":"curr-month"})}if(a._value.year==e&&a._value.month==t){l[s+a._value.day-2]["class"]+=" selected"}if(l.length%7>0){c=new Date(e,t,1);for(var r=1,o=7-l.length%7;r<=o;r++){l.push({value:d(c.getFullYear(),c.getMonth()+1,r),date:r,"class":"next-month"})}}a.find(".datepicker-select-year .datepicker-select-selected").data("year",e).text(e+"年");a.find(".datepicker-select-month .datepicker-select-selected").data("month",t).text(t+"月");a.find(".body tbody").html(i(l))}function i(e){var t=[];t.push("<tr>");for(var a=0,l=e.length;a<l;a++){t.push('<td class="cell '+e[a]["class"]+'" data-value="'+e[a]["value"]+'">'+e[a]["date"]+"</td>");if((a+1)%7==0&&a!=l-1){t.push("</tr></tr>")}}t.push("</tr>");return t.join("")}function c(){var e=new Date;var t=e.getFullYear()-5;var a=[];for(var l=0;l<12;l++){a.push('<li data-year="'+(t+l)+'">'+(t+l)+"年</li>")}return a.join("")}function d(e,t,a){t=t<10?"0"+t:t;a=a<10?"0"+a:a;return e+"-"+t+"-"+a}e.fn.datepicker=function(){var t=e(this);a._instance=true;t.on({focus:function(i){var c=e(this);var d=c.offset();a.css({top:d.top+c.outerHeight(),left:d.left});var s=t.val();var n=[];if(s==""){var r=new Date;n=[r.getFullYear(),r.getMonth()+1,r.getDate()]}else{n=s.split("-")}a._bind=t;a._value={year:n[0]-0,month:n[1]-0,day:n[2]-0};l(n[0]-0,n[1]-0);a.show()}})}})(jQuery);
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。