25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3 년 전
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378
  1. //No.1 时间选择器
  2. $(document).ready(function(){
  3. var hour_temp = "";
  4. var minute_temp = "";
  5. for(var i=0;i<24;i++){
  6. if(i<10){
  7. if(i==0){
  8. hour_temp += '<div class="select_hour select_option">0'+i+'</div>'
  9. }else{
  10. hour_temp += '<div class="select_hour">0'+i+'</div>'
  11. }
  12. }else{
  13. hour_temp += '<div class="select_hour">'+i+'</div>'
  14. }
  15. }
  16. for(var i=0;i<60;i++){
  17. if(i<10){
  18. if(i==0){
  19. minute_temp += '<div class="select_minute select_option">0'+i+'</div>'
  20. }else{
  21. minute_temp += '<div class="select_minute">0'+i+'</div>'
  22. }
  23. }else{
  24. minute_temp += '<div class="select_minute">'+i+'</div>'
  25. }
  26. }
  27. $(".select_hour_box").html(hour_temp);
  28. $(".select_minute_box").html(minute_temp);
  29. $(".select_hour").on("click",function(){
  30. var time_id = $(this).closest(".timepicker_box").attr("id");
  31. var parent_height = $("#"+time_id).find(".timepicker_select").offset().top;
  32. var this_height = $(this).offset().top;
  33. var scroll_height = $("#"+time_id).find(".select_hour_box").scrollTop();
  34. var move_height = this_height - parent_height + scroll_height;
  35. $("#"+time_id).find(".select_hour_box").animate({scrollTop:move_height},200);
  36. $("#"+time_id).find(".select_hour_box").children().removeClass("select_option");
  37. $(this).addClass("select_option");
  38. var times = $("#"+time_id).find(".select_hour_box .select_option").text() + ':' + $("#"+time_id).find(".select_minute_box .select_option").text();
  39. $("#"+time_id).find(".timepicker input").val(times);
  40. });
  41. $(".select_minute").on("click",function(){
  42. var time_id = $(this).closest(".timepicker_box").attr("id");
  43. var parent_height = $("#"+time_id).find(".timepicker_select").offset().top;
  44. var this_height = $(this).offset().top;
  45. var scroll_height = $("#"+time_id).find(".select_minute_box").scrollTop();
  46. var move_height = this_height - parent_height + scroll_height;
  47. $("#"+time_id).find(".select_minute_box").animate({scrollTop:move_height},200);
  48. $("#"+time_id).find(".select_minute_box").children().removeClass("select_option");
  49. $(this).addClass("select_option");
  50. var times = $("#"+time_id).find(".select_hour_box .select_option").text() + ':' + $("#"+time_id).find(".select_minute_box .select_option").text();
  51. $("#"+time_id).find(".timepicker input").val(times);
  52. });
  53. $(".timepicker_box").on("click",function(e){
  54. var time_id = this.id;
  55. $(".timepicker_select").not("#"+time_id+" .timepicker_select").animate({
  56. height:'hide'
  57. },200);
  58. $("#"+this.id).find(".timepicker_select").animate({
  59. height:'show'
  60. },200);
  61. e.stopPropagation();
  62. });
  63. });
  64. $(document).on("click",function(e){
  65. var time_id = this.id;
  66. $(".timepicker_select").animate({
  67. height:'hide'
  68. },200);
  69. e.stopPropagation();
  70. });
  71. //。。。。。。。。。。。。。。。。。。。。。。。。。。。。//
  72. //No.2 分页
  73. (function($){
  74. var ms = {
  75. init:function(obj,args){
  76. return (function(){
  77. ms.fillHtml(obj,args);
  78. ms.bindEvent(obj,args);
  79. })();
  80. },
  81. //填充html
  82. fillHtml:function(obj,args){
  83. return (function(){
  84. obj.empty();
  85. //上一页
  86. if(args.current > 1){
  87. obj.append('<a href="javascript:;" class="prevPage icon-left"></a>');
  88. }else{
  89. obj.remove('.prevPage');
  90. obj.append('<span class="disabled icon-left"></span>');
  91. }
  92. //中间页码
  93. if(args.current != 1 && args.current >= 4 && args.pageCount != 4){
  94. obj.append('<a href="javascript:;" class="tcdNumber">'+1+'</a>');
  95. }
  96. if(args.current-2 > 2 && args.current <= args.pageCount && args.pageCount > 5){
  97. obj.append('<span>...</span>');
  98. }
  99. var start = args.current -2,end = args.current+2;
  100. if((start > 1 && args.current < 4)||args.current == 1){
  101. end++;
  102. }
  103. if(args.current > args.pageCount-4 && args.current >= args.pageCount){
  104. start--;
  105. }
  106. for (;start <= end; start++) {
  107. if(start <= args.pageCount && start >= 1){
  108. if(start != args.current){
  109. obj.append('<a href="javascript:;" class="tcdNumber">'+ start +'</a>');
  110. }else{
  111. obj.append('<span class="current">'+ start +'</span>');
  112. }
  113. }
  114. }
  115. if(args.current + 2 < args.pageCount - 1 && args.current >= 1 && args.pageCount > 5){
  116. obj.append('<span>...</span>');
  117. }
  118. if(args.current != args.pageCount && args.current < args.pageCount -2 && args.pageCount != 4){
  119. obj.append('<a href="javascript:;" class="tcdNumber">'+args.pageCount+'</a>');
  120. }
  121. //下一页
  122. if(args.current < args.pageCount){
  123. obj.append('<a href="javascript:;" class="nextPage icon-right"></a>');
  124. }else{
  125. obj.remove('.nextPage');
  126. obj.append('<span class="disabled icon-right"></span>');
  127. }
  128. obj.append('<span class="pagecount">共'+args.pageCount+'页</span>');
  129. //跳转页码
  130. if(args.turndown == 'true'){
  131. obj.append('<span class="countYe">跳至<input type="text" onkeyup="this.value=this.value.replace(/\\D/g,\'\')" onafterpaste="this.value=this.value.replace(/\\D/g,\'\')" maxlength='+args.pageCount.toString().length+'>页<a href="javascript:;" class="turndown">确定</a><span>');
  132. }
  133. })();
  134. },
  135. //绑定事件
  136. bindEvent:function(obj,args){
  137. return (function(){
  138. obj.off("click","a.tcdNumber"); //移除原有事件 避免重复绑定
  139. obj.on("click","a.tcdNumber",function(){
  140. var current = parseInt($(this).text());
  141. ms.fillHtml(obj,{"current":current,"pageCount":args.pageCount,"turndown":args.turndown});
  142. if(typeof(args.backFn)=="function"){
  143. args.backFn(current);
  144. }
  145. });
  146. //上一页
  147. obj.off("click","a.prevPage"); //移除原有事件 避免重复绑定
  148. obj.on("click","a.prevPage",function(){
  149. var current = parseInt(obj.children("span.current").text());
  150. ms.fillHtml(obj,{"current":current-1,"pageCount":args.pageCount,"turndown":args.turndown});
  151. if(typeof(args.backFn)=="function"){
  152. args.backFn(current-1);
  153. }
  154. });
  155. //下一页
  156. obj.off("click","a.nextPage"); //移除原有事件 避免重复绑定
  157. obj.on("click","a.nextPage",function(){
  158. var current = parseInt(obj.children("span.current").text());
  159. ms.fillHtml(obj,{"current":current+1,"pageCount":args.pageCount,"turndown":args.turndown});
  160. if(typeof(args.backFn)=="function"){
  161. args.backFn(current+1);
  162. }
  163. });
  164. //跳转
  165. obj.off("click","a.turndown"); //移除原有事件 避免重复绑定
  166. obj.on("click","a.turndown",function(){
  167. var page = $("span.countYe input").val();
  168. if(page.trim()==""){page=1;}
  169. page=parseInt(page);
  170. if(page==0){page=1;}
  171. if (page > args.pageCount) {
  172. ZZAlertInfo("您的输入有误,请重新输入!");
  173. $("span.countYe input").val('');
  174. $("span.countYe input").focus();
  175. return;
  176. }
  177. ms.fillHtml(obj,{"current":page,"pageCount":args.pageCount,"turndown":args.turndown});
  178. if(typeof(args.backFn)=="function"){
  179. args.backFn(page);
  180. }
  181. // var page = parseInt($("span.countYe input").val());
  182. // if (page > args.pageCount) {
  183. // ZZAlertInfo("您的输入有误,请重新输入!");
  184. // return;
  185. // }
  186. // ms.fillHtml(obj,{"current":page,"pageCount":args.pageCount,"turndown":args.turndown});
  187. // if(typeof(args.backFn)=="function"){
  188. // args.backFn(page);
  189. // }
  190. });
  191. })();
  192. }
  193. }
  194. $.fn.createPage = function(options){
  195. var args = $.extend({
  196. pageCount : 10,
  197. current : 1,
  198. turndown:true,
  199. backFn : function(){}
  200. },options);
  201. ms.init(this,args);
  202. }
  203. })(jQuery);
  204. //NO.3 下拉筛选
  205. (function (factory) {
  206. 'use strict';
  207. if (typeof define === 'function' && define.amd) {
  208. // AMD. Register as an anonymous module.
  209. define(['jquery'], factory);
  210. } else if (typeof exports === 'object' && typeof require === 'function') {
  211. // Browserify
  212. factory(require('jquery'));
  213. } else {
  214. // Browser globals
  215. factory(jQuery);
  216. }
  217. }(function ( $, undefined ) {
  218. var pluginName = "comboSelect",
  219. dataKey = 'comboselect';
  220. var defaults = {
  221. comboClass : 'combo-select',
  222. comboArrowClass : 'combo-arrow',
  223. comboDropDownClass : 'combo-dropdown',
  224. inputClass : 'combo-input text-input',
  225. disabledClass : 'option-disabled',
  226. hoverClass : 'option-hover',
  227. selectedClass : 'option-selected',
  228. markerClass : 'combo-marker',
  229. themeClass : '',
  230. maxHeight : 200,
  231. extendStyle : true,
  232. focusInput : true
  233. };
  234. /**
  235. * Utility functions
  236. */
  237. var keys = {
  238. ESC: 27,
  239. TAB: 9,
  240. RETURN: 13,
  241. LEFT: 37,
  242. UP: 38,
  243. RIGHT: 39,
  244. DOWN: 40,
  245. ENTER: 13,
  246. SHIFT: 16
  247. },
  248. isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
  249. /**
  250. * Constructor
  251. * @param {[Node]} element [Select element]
  252. * @param {[Object]} options [Option object]
  253. */
  254. function Plugin ( element, options ) {
  255. /* Name of the plugin */
  256. this._name = pluginName;
  257. /* Reverse lookup */
  258. this.el = element
  259. /* Element */
  260. this.$el = $(element)
  261. /* If multiple select: stop */
  262. if(this.$el.prop('multiple')) return;
  263. /* Settings */
  264. this.settings = $.extend( {}, defaults, options, this.$el.data() );
  265. /* Defaults */
  266. this._defaults = defaults;
  267. /* Options */
  268. this.$options = this.$el.find('option, optgroup')
  269. /* Initialize */
  270. this.init();
  271. /* Instances */
  272. $.fn[ pluginName ].instances.push(this);
  273. }
  274. $.extend(Plugin.prototype, {
  275. init: function () {
  276. /* Construct the comboselect */
  277. this._construct();
  278. /* Add event bindings */
  279. this._events();
  280. },
  281. _construct: function(){
  282. var self = this
  283. /**
  284. * Add negative TabIndex to `select`
  285. * Preserves previous tabindex
  286. */
  287. this.$el.data('plugin_'+ dataKey + '_tabindex', this.$el.prop('tabindex'))
  288. /* Add a tab index for desktop browsers */
  289. !isMobile && this.$el.prop("tabIndex", -1)
  290. /**
  291. * Wrap the Select
  292. */
  293. this.$container = this.$el.wrapAll('<div class="' + this.settings.comboClass + ' '+ this.settings.themeClass + '" />').parent();
  294. /**
  295. * Check if select has a width attribute
  296. */
  297. if(this.settings.extendStyle && this.$el.attr('style')){
  298. this.$container.attr('style', this.$el.attr("style"))
  299. }
  300. /**
  301. * Append dropdown arrow
  302. */
  303. this.$arrow = $('<div class="'+ this.settings.comboArrowClass+ '" />').appendTo(this.$container)
  304. /**
  305. * Append dropdown
  306. */
  307. this.$dropdown = $('<ul class="'+this.settings.comboDropDownClass+'" />').appendTo(this.$container)
  308. /**
  309. * Create dropdown options
  310. */
  311. var o = '', k = 0, p = '';
  312. this.selectedIndex = this.$el.prop('selectedIndex')
  313. this.$options.each(function(i, e){
  314. if(e.nodeName.toLowerCase() == 'optgroup'){
  315. return o+='<li class="option-group">'+this.label+'</li>'
  316. }
  317. if(!e.value) p = e.innerHTML
  318. o+='<li class="'+(this.disabled? self.settings.disabledClass : "option-item") + ' ' +(k == self.selectedIndex? self.settings.selectedClass : '')+ '" data-index="'+(k)+'" data-value="'+this.value+'">'+ (this.innerHTML) + '</li>'
  319. k++;
  320. })
  321. this.$dropdown.html(o)
  322. /**
  323. * Items
  324. */
  325. this.$items = this.$dropdown.children();
  326. /**
  327. * Append Input
  328. */
  329. this.$input = $('<input type="text"' + (isMobile? 'tabindex="-1"': '') + ' placeholder="'+p+'" class="'+ this.settings.inputClass + '">').appendTo(this.$container)
  330. /* Update input text */
  331. this._updateInput()
  332. },
  333. _events: function(){
  334. /* Input: focus */
  335. this.$container.on('focus.input', 'input', $.proxy(this._focus, this))
  336. /**
  337. * Input: mouseup
  338. * For input select() event to function correctly
  339. */
  340. this.$container.on('mouseup.input', 'input', function(e){
  341. e.preventDefault()
  342. })
  343. /* Input: blur */
  344. this.$container.on('blur.input', 'input', $.proxy(this._blur, this))
  345. /* Select: change */
  346. this.$el.on('change.select', $.proxy(this._change, this))
  347. /* Select: focus */
  348. this.$el.on('focus.select', $.proxy(this._focus, this))
  349. /* Select: blur */
  350. this.$el.on('blur.select', $.proxy(this._blurSelect, this))
  351. /* Dropdown Arrow: click */
  352. this.$container.on('click.arrow', '.'+this.settings.comboArrowClass , $.proxy(this._toggle, this))
  353. /* Dropdown: close */
  354. this.$container.on('comboselect:close', $.proxy(this._close, this))
  355. /* Dropdown: open */
  356. this.$container.on('comboselect:open', $.proxy(this._open, this))
  357. /* HTML Click */
  358. $('html').off('click.comboselect').on('click.comboselect', function(){
  359. $.each($.fn[ pluginName ].instances, function(i, plugin){
  360. plugin.$container.trigger('comboselect:close')
  361. })
  362. });
  363. /* Stop `event:click` bubbling */
  364. this.$container.on('click.comboselect', function(e){
  365. e.stopPropagation();
  366. })
  367. /* Input: keydown */
  368. this.$container.on('keydown', 'input', $.proxy(this._keydown, this))
  369. /* Input: keyup */
  370. this.$container.on('keyup', 'input', $.proxy(this._keyup, this))
  371. /* Dropdown item: click */
  372. this.$container.on('click.item', '.option-item', $.proxy(this._select, this))
  373. },
  374. _keydown: function(event){
  375. switch(event.which){
  376. case keys.UP:
  377. this._move('up', event)
  378. break;
  379. case keys.DOWN:
  380. this._move('down', event)
  381. break;
  382. case keys.TAB:
  383. this._enter(event)
  384. break;
  385. case keys.RIGHT:
  386. this._autofill(event);
  387. break;
  388. case keys.ENTER:
  389. this._enter(event);
  390. break;
  391. default:
  392. break;
  393. }
  394. },
  395. _keyup: function(event){
  396. switch(event.which){
  397. case keys.ESC:
  398. this.$container.trigger('comboselect:close')
  399. break;
  400. case keys.ENTER:
  401. case keys.UP:
  402. case keys.DOWN:
  403. case keys.LEFT:
  404. case keys.RIGHT:
  405. case keys.TAB:
  406. case keys.SHIFT:
  407. break;
  408. default:
  409. this._filter(event.target.value)
  410. break;
  411. }
  412. },
  413. _enter: function(event){
  414. var item = this._getHovered()
  415. item.length && this._select(item);
  416. /* Check if it enter key */
  417. if(event && event.which == keys.ENTER){
  418. if(!item.length) {
  419. /* Check if its illegal value */
  420. this._blur();
  421. return true;
  422. }
  423. event.preventDefault();
  424. }
  425. },
  426. _move: function(dir){
  427. var items = this._getVisible(),
  428. current = this._getHovered(),
  429. index = current.prevAll('.option-item').filter(':visible').length,
  430. total = items.length
  431. switch(dir){
  432. case 'up':
  433. index--;
  434. (index < 0) && (index = (total - 1));
  435. break;
  436. case 'down':
  437. index++;
  438. (index >= total) && (index = 0);
  439. break;
  440. }
  441. items
  442. .removeClass(this.settings.hoverClass)
  443. .eq(index)
  444. .addClass(this.settings.hoverClass)
  445. if(!this.opened) this.$container.trigger('comboselect:open');
  446. this._fixScroll()
  447. },
  448. _select: function(event){
  449. var item = event.currentTarget? $(event.currentTarget) : $(event);
  450. if(!item.length) return;
  451. /**
  452. * 1. get Index
  453. */
  454. var index = item.data('index');
  455. this._selectByIndex(index);
  456. this.$container.trigger('comboselect:close')
  457. },
  458. _selectByIndex: function(index){
  459. /**
  460. * Set selected index and trigger change
  461. * @type {[type]}
  462. */
  463. if(typeof index == 'undefined'){
  464. index = 0
  465. }
  466. if(this.$el.prop('selectedIndex') != index){
  467. this.$el.prop('selectedIndex', index).trigger('change');
  468. }
  469. },
  470. _autofill: function(){
  471. var item = this._getHovered();
  472. if(item.length){
  473. var index = item.data('index')
  474. this._selectByIndex(index)
  475. }
  476. },
  477. _filter: function(search){
  478. var self = this,
  479. items = this._getAll();
  480. needle = $.trim(search).toLowerCase(),
  481. reEscape = new RegExp('(\\' + ['/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\'].join('|\\') + ')', 'g'),
  482. pattern = '(' + search.replace(reEscape, '\\$1') + ')';
  483. /**
  484. * Unwrap all markers
  485. */
  486. $('.'+self.settings.markerClass, items).contents().unwrap();
  487. /* Search */
  488. if(needle){
  489. /* Hide Disabled and optgroups */
  490. this.$items.filter('.option-group, .option-disabled').hide();
  491. items
  492. .hide()
  493. .filter(function(){
  494. var $this = $(this),
  495. text = $.trim($this.text()).toLowerCase();
  496. /* Found */
  497. if(text.toString().indexOf(needle) != -1){
  498. /**
  499. * Wrap the selection
  500. */
  501. $this
  502. .html(function(index, oldhtml){
  503. return oldhtml.replace(new RegExp(pattern, 'gi'), '<span class="'+self.settings.markerClass+'">$1</span>')
  504. })
  505. return true
  506. }
  507. })
  508. .show()
  509. }else{
  510. this.$items.show();
  511. }
  512. /* Open the comboselect */
  513. this.$container.trigger('comboselect:open')
  514. },
  515. _highlight: function(){
  516. /*
  517. 1. Check if there is a selected item
  518. 2. Add hover class to it
  519. 3. If not add hover class to first item
  520. */
  521. var visible = this._getVisible().removeClass(this.settings.hoverClass),
  522. $selected = visible.filter('.'+this.settings.selectedClass)
  523. if($selected.length){
  524. $selected.addClass(this.settings.hoverClass);
  525. }else{
  526. visible
  527. .removeClass(this.settings.hoverClass)
  528. .first()
  529. .addClass(this.settings.hoverClass)
  530. }
  531. },
  532. _updateInput: function(){
  533. var selected = this.$el.prop('selectedIndex')
  534. if(this.$el.val()){
  535. text = this.$el.find('option').eq(selected).text()
  536. this.$input.val(text)
  537. }else{
  538. this.$input.val('')
  539. }
  540. return this._getAll()
  541. .removeClass(this.settings.selectedClass)
  542. .filter(function(){
  543. return $(this).data('index') == selected
  544. })
  545. .addClass(this.settings.selectedClass)
  546. },
  547. _blurSelect: function(){
  548. this.$container.removeClass('combo-focus');
  549. },
  550. _focus: function(event){
  551. /* Toggle focus class */
  552. this.$container.toggleClass('combo-focus', !this.opened);
  553. /* If mobile: stop */
  554. if(isMobile) return;
  555. /* Open combo */
  556. if(!this.opened) this.$container.trigger('comboselect:open');
  557. /* Select the input */
  558. this.settings.focusInput && event && event.currentTarget && event.currentTarget.nodeName == 'INPUT' && event.currentTarget.select()
  559. },
  560. _blur: function(){
  561. /**
  562. * 1. Get hovered item
  563. * 2. If not check if input value == select option
  564. * 3. If none
  565. */
  566. var val = $.trim(this.$input.val().toLowerCase()),
  567. isNumber = !isNaN(val);
  568. var index = this.$options.filter(function(){
  569. if(isNumber){
  570. return parseInt($.trim(this.innerHTML).toLowerCase()) == val
  571. }
  572. return $.trim(this.innerHTML).toLowerCase() == val
  573. }).prop('index')
  574. /* Select by Index */
  575. this._selectByIndex(index)
  576. },
  577. _change: function(){
  578. this._updateInput();
  579. },
  580. _getAll: function(){
  581. return this.$items.filter('.option-item')
  582. },
  583. _getVisible: function(){
  584. return this.$items.filter('.option-item').filter(':visible')
  585. },
  586. _getHovered: function(){
  587. return this._getVisible().filter('.' + this.settings.hoverClass);
  588. },
  589. _open: function(){
  590. var self = this
  591. this.$container.addClass('combo-open')
  592. this.opened = true
  593. /* Focus input field */
  594. this.settings.focusInput && setTimeout(function(){ !self.$input.is(':focus') && self.$input.focus(); });
  595. /* Highligh the items */
  596. this._highlight()
  597. /* Fix scroll */
  598. this._fixScroll()
  599. /* Close all others */
  600. $.each($.fn[ pluginName ].instances, function(i, plugin){
  601. if(plugin != self && plugin.opened) plugin.$container.trigger('comboselect:close')
  602. })
  603. },
  604. _toggle: function(){
  605. this.opened? this._close.call(this) : this._open.call(this)
  606. },
  607. _close: function(){
  608. this.$container.removeClass('combo-open combo-focus')
  609. this.$container.trigger('comboselect:closed')
  610. this.opened = false
  611. /* Show all items */
  612. this.$items.show();
  613. },
  614. _fixScroll: function(){
  615. /**
  616. * If dropdown is hidden
  617. */
  618. if(this.$dropdown.is(':hidden')) return;
  619. /**
  620. * Else
  621. */
  622. var item = this._getHovered();
  623. if(!item.length) return;
  624. /**
  625. * Scroll
  626. */
  627. var offsetTop,
  628. upperBound,
  629. lowerBound,
  630. heightDelta = item.outerHeight()
  631. offsetTop = item[0].offsetTop;
  632. upperBound = this.$dropdown.scrollTop();
  633. lowerBound = upperBound + this.settings.maxHeight - heightDelta;
  634. if (offsetTop < upperBound) {
  635. this.$dropdown.scrollTop(offsetTop);
  636. } else if (offsetTop > lowerBound) {
  637. this.$dropdown.scrollTop(offsetTop - this.settings.maxHeight + heightDelta);
  638. }
  639. },
  640. /**
  641. * Destroy API
  642. */
  643. dispose: function(){
  644. /* Remove combo arrow, input, dropdown */
  645. this.$arrow.remove()
  646. this.$input.remove()
  647. this.$dropdown.remove()
  648. /* Remove tabindex property */
  649. this.$el
  650. .removeAttr("tabindex")
  651. /* Check if there is a tabindex set before */
  652. if(!!this.$el.data('plugin_'+ dataKey + '_tabindex')){
  653. this.$el.prop('tabindex', this.$el.data('plugin_'+ dataKey + '_tabindex'))
  654. }
  655. /* Unwrap */
  656. this.$el.unwrap()
  657. /* Remove data */
  658. this.$el.removeData('plugin_'+dataKey)
  659. /* Remove tabindex data */
  660. this.$el.removeData('plugin_'+dataKey + '_tabindex')
  661. /* Remove change event on select */
  662. this.$el.off('change.select focus.select blur.select');
  663. }
  664. });
  665. // A really lightweight plugin wrapper around the constructor,
  666. // preventing against multiple instantiations
  667. $.fn[ pluginName ] = function ( options, args ) {
  668. this.each(function() {
  669. var $e = $(this),
  670. instance = $e.data('plugin_'+dataKey)
  671. if (typeof options === 'string') {
  672. if (instance && typeof instance[options] === 'function') {
  673. instance[options](args);
  674. }
  675. }else{
  676. if (instance && instance.dispose) {
  677. instance.dispose();
  678. }
  679. $.data( this, "plugin_" + dataKey, new Plugin( this, options ) );
  680. }
  681. });
  682. // chain jQuery functions
  683. return this;
  684. };
  685. $.fn[ pluginName ].instances = [];
  686. }));
  687. //No.4日历
  688. (function(a) { if(typeof define === "function" && define.amd) { define(["jquery"], a) } else { if(typeof exports === "object") { a(require("jquery")) } else { a(jQuery) } } }(function(d, f) { if(!("indexOf" in Array.prototype)) { Array.prototype.indexOf = function(k, j) { if(j === f) { j = 0 } if(j < 0) { j += this.length } if(j < 0) { j = 0 } for(var l = this.length; j < l; j++) { if(j in this && this[j] === k) { return j } } return -1 } }
  689. function a() { var q, k, p, l, j, n, m, o;
  690. k = (new Date()).toString();
  691. p = ((m = k.split("(")[1]) !== null ? m.slice(0, -1) : 0) || k.split(" "); if(p instanceof Array) { n = []; for(var l = 0, j = p.length; l < j; l++) { o = p[l]; if((q = (m = o.match(/\b[A-Z]+\b/)) !== null) ? m[0] : 0) { n.push(q) } } p = n.pop() } return p }
  692. function h() { return new Date(Date.UTC.apply(Date, arguments)) } var g = function(k, j) { var m = this;
  693. this.element = d(k);
  694. this.container = j.container || "body";
  695. this.language = j.language || this.element.data("date-language") || "en";
  696. this.language = this.language in e ? this.language : this.language.split("-")[0];
  697. this.language = this.language in e ? this.language : "en";
  698. this.isRTL = e[this.language].rtl || false;
  699. this.formatType = j.formatType || this.element.data("format-type") || "standard";
  700. this.format = c.parseFormat(j.format || this.element.data("date-format") || e[this.language].format || c.getDefaultFormat(this.formatType, "input"), this.formatType);
  701. this.isInline = false;
  702. this.isVisible = false;
  703. this.isInput = this.element.is("input");
  704. this.fontAwesome = j.fontAwesome || this.element.data("font-awesome") || false;
  705. this.bootcssVer = j.bootcssVer || (this.isInput ? (this.element.is(".form-control") ? 3 : 2) : (this.bootcssVer = this.element.is(".input-group") ? 3 : 2));
  706. this.component = this.element.is(".date") ? (this.bootcssVer === 3 ? this.element.find(".input-group-addon .glyphicon-th, .input-group-addon .glyphicon-time, .input-group-addon .glyphicon-remove, .input-group-addon .glyphicon-calendar, .input-group-addon .fa-calendar, .input-group-addon .fa-clock-o").parent() : this.element.find(".add-on .icon-th, .add-on .icon-time, .add-on .icon-calendar, .add-on .fa-calendar, .add-on .fa-clock-o").parent()) : false;
  707. this.componentReset = this.element.is(".date") ? (this.bootcssVer === 3 ? this.element.find(".input-group-addon .glyphicon-remove, .input-group-addon .fa-times").parent() : this.element.find(".add-on .icon-remove, .add-on .fa-times").parent()) : false;
  708. this.hasInput = this.component && this.element.find("input").length; if(this.component && this.component.length === 0) { this.component = false } this.linkField = j.linkField || this.element.data("link-field") || false;
  709. this.linkFormat = c.parseFormat(j.linkFormat || this.element.data("link-format") || c.getDefaultFormat(this.formatType, "link"), this.formatType);
  710. this.minuteStep = j.minuteStep || this.element.data("minute-step") || 5;
  711. this.pickerPosition = j.pickerPosition || this.element.data("picker-position") || "bottom-right";
  712. this.showMeridian = j.showMeridian || this.element.data("show-meridian") || false;
  713. this.initialDate = j.initialDate || new Date();
  714. this.zIndex = j.zIndex || this.element.data("z-index") || f;
  715. this.title = typeof j.title === "undefined" ? false : j.title;
  716. this.timezone = j.timezone || a();
  717. this.icons = { leftArrow: this.fontAwesome ? "fa-arrow-left" : (this.bootcssVer === 3 ? "glyphicon-arrow-left" : "glyphicon-arrow-left"), rightArrow: this.fontAwesome ? "fa-arrow-right" : (this.bootcssVer === 3 ? "glyphicon-arrow-right" : "glyphicon-arrow-right") };
  718. this.icontype = this.fontAwesome ? "fa" : "glyphicon";
  719. this._attachEvents();
  720. this.clickedOutside = function(n) { if(d(n.target).closest(".datetimepicker").length === 0) { m.hide() } };
  721. this.formatViewType = "datetime"; if("formatViewType" in j) { this.formatViewType = j.formatViewType } else { if("formatViewType" in this.element.data()) { this.formatViewType = this.element.data("formatViewType") } } this.minView = 0; if("minView" in j) { this.minView = j.minView } else { if("minView" in this.element.data()) { this.minView = this.element.data("min-view") } } this.minView = c.convertViewMode(this.minView);
  722. this.maxView = c.modes.length - 1; if("maxView" in j) { this.maxView = j.maxView } else { if("maxView" in this.element.data()) { this.maxView = this.element.data("max-view") } } this.maxView = c.convertViewMode(this.maxView);
  723. this.wheelViewModeNavigation = false; if("wheelViewModeNavigation" in j) { this.wheelViewModeNavigation = j.wheelViewModeNavigation } else { if("wheelViewModeNavigation" in this.element.data()) { this.wheelViewModeNavigation = this.element.data("view-mode-wheel-navigation") } } this.wheelViewModeNavigationInverseDirection = false; if("wheelViewModeNavigationInverseDirection" in j) { this.wheelViewModeNavigationInverseDirection = j.wheelViewModeNavigationInverseDirection } else { if("wheelViewModeNavigationInverseDirection" in this.element.data()) { this.wheelViewModeNavigationInverseDirection = this.element.data("view-mode-wheel-navigation-inverse-dir") } } this.wheelViewModeNavigationDelay = 100; if("wheelViewModeNavigationDelay" in j) { this.wheelViewModeNavigationDelay = j.wheelViewModeNavigationDelay } else { if("wheelViewModeNavigationDelay" in this.element.data()) { this.wheelViewModeNavigationDelay = this.element.data("view-mode-wheel-navigation-delay") } } this.startViewMode = 2; if("startView" in j) { this.startViewMode = j.startView } else { if("startView" in this.element.data()) { this.startViewMode = this.element.data("start-view") } } this.startViewMode = c.convertViewMode(this.startViewMode);
  724. this.viewMode = this.startViewMode;
  725. this.viewSelect = this.minView; if("viewSelect" in j) { this.viewSelect = j.viewSelect } else { if("viewSelect" in this.element.data()) { this.viewSelect = this.element.data("view-select") } } this.viewSelect = c.convertViewMode(this.viewSelect);
  726. this.forceParse = true; if("forceParse" in j) { this.forceParse = j.forceParse } else { if("dateForceParse" in this.element.data()) { this.forceParse = this.element.data("date-force-parse") } } var l = this.bootcssVer === 3 ? c.templateV3 : c.template; while(l.indexOf("{iconType}") !== -1) { l = l.replace("{iconType}", this.icontype) } while(l.indexOf("{leftArrow}") !== -1) { l = l.replace("{leftArrow}", this.icons.leftArrow) } while(l.indexOf("{rightArrow}") !== -1) { l = l.replace("{rightArrow}", this.icons.rightArrow) } this.picker = d(l).appendTo(this.isInline ? this.element : this.container).on({ click: d.proxy(this.click, this), mousedown: d.proxy(this.mousedown, this) }); if(this.wheelViewModeNavigation) { if(d.fn.mousewheel) { this.picker.on({ mousewheel: d.proxy(this.mousewheel, this) }) } else { console.log("Mouse Wheel event is not supported. Please include the jQuery Mouse Wheel plugin before enabling this option") } } if(this.isInline) { this.picker.addClass("datetimepicker-inline") } else { this.picker.addClass("datetimepicker-dropdown-" + this.pickerPosition + " dropdown-menu") } if(this.isRTL) { this.picker.addClass("datetimepicker-rtl"); var i = this.bootcssVer === 3 ? ".prev span, .next span" : ".prev i, .next i";
  727. this.picker.find(i).toggleClass(this.icons.leftArrow + " " + this.icons.rightArrow) } d(document).on("mousedown touchend", this.clickedOutside);
  728. this.autoclose = false; if("autoclose" in j) { this.autoclose = j.autoclose } else { if("dateAutoclose" in this.element.data()) { this.autoclose = this.element.data("date-autoclose") } } this.keyboardNavigation = true; if("keyboardNavigation" in j) { this.keyboardNavigation = j.keyboardNavigation } else { if("dateKeyboardNavigation" in this.element.data()) { this.keyboardNavigation = this.element.data("date-keyboard-navigation") } } this.todayBtn = (j.todayBtn || this.element.data("date-today-btn") || false);
  729. this.clearBtn = (j.clearBtn || this.element.data("date-clear-btn") || false);
  730. this.todayHighlight = (j.todayHighlight || this.element.data("date-today-highlight") || false);
  731. this.weekStart = 0; if(typeof j.weekStart !== "undefined") { this.weekStart = j.weekStart } else { if(typeof this.element.data("date-weekstart") !== "undefined") { this.weekStart = this.element.data("date-weekstart") } else { if(typeof e[this.language].weekStart !== "undefined") { this.weekStart = e[this.language].weekStart } } } this.weekStart = this.weekStart % 7;
  732. this.weekEnd = ((this.weekStart + 6) % 7);
  733. this.onRenderDay = function(n) { var p = (j.onRenderDay || function() { return [] })(n); if(typeof p === "string") { p = [p] } var o = ["day"]; return o.concat((p ? p : [])) };
  734. this.onRenderHour = function(n) { var p = (j.onRenderHour || function() { return [] })(n); var o = ["hour"]; if(typeof p === "string") { p = [p] } return o.concat((p ? p : [])) };
  735. this.onRenderMinute = function(n) { var p = (j.onRenderMinute || function() { return [] })(n); var o = ["minute"]; if(typeof p === "string") { p = [p] } if(n < this.startDate || n > this.endDate) { o.push("disabled") } else { if(Math.floor(this.date.getUTCMinutes() / this.minuteStep) === Math.floor(n.getUTCMinutes() / this.minuteStep)) { o.push("active") } } return o.concat((p ? p : [])) };
  736. this.onRenderYear = function(n) { var p = (j.onRenderYear || function() { return [] })(n); var o = ["year"]; if(typeof p === "string") { p = [p] } if(this.date.getUTCFullYear() === n.getUTCFullYear()) { o.push("active") } if(n < this.startDate || n > this.endDate) { o.push("disabled") } return o.concat((p ? p : [])) };
  737. this.onRenderMonth = function(n) { var p = (j.onRenderMonth || function() { return [] })(n); var o = ["month"]; if(typeof p === "string") { p = [p] } return o.concat((p ? p : [])) };
  738. this.startDate = new Date(-8639968443048000);
  739. this.endDate = new Date(8639968443048000);
  740. this.datesDisabled = [];
  741. this.daysOfWeekDisabled = [];
  742. this.setStartDate(j.startDate || this.element.data("date-startdate"));
  743. this.setEndDate(j.endDate || this.element.data("date-enddate"));
  744. this.setDatesDisabled(j.datesDisabled || this.element.data("date-dates-disabled"));
  745. this.setDaysOfWeekDisabled(j.daysOfWeekDisabled || this.element.data("date-days-of-week-disabled"));
  746. this.setMinutesDisabled(j.minutesDisabled || this.element.data("date-minute-disabled"));
  747. this.setHoursDisabled(j.hoursDisabled || this.element.data("date-hour-disabled"));
  748. this.fillDow();
  749. this.fillMonths();
  750. this.update();
  751. this.showMode(); if(this.isInline) { this.show() } };
  752. g.prototype = { constructor: g, _events: [], _attachEvents: function() { this._detachEvents(); if(this.isInput) { this._events = [
  753. [this.element, { focus: d.proxy(this.show, this), keyup: d.proxy(this.update, this), keydown: d.proxy(this.keydown, this) }]
  754. ] } else { if(this.component && this.hasInput) { this._events = [
  755. [this.element.find("input"), { focus: d.proxy(this.show, this), keyup: d.proxy(this.update, this), keydown: d.proxy(this.keydown, this) }],
  756. [this.component, { click: d.proxy(this.show, this) }]
  757. ]; if(this.componentReset) { this._events.push([this.componentReset, { click: d.proxy(this.reset, this) }]) } } else { if(this.element.is("div")) { this.isInline = true } else { this._events = [
  758. [this.element, { click: d.proxy(this.show, this) }]
  759. ] } } } for(var j = 0, k, l; j < this._events.length; j++) { k = this._events[j][0];
  760. l = this._events[j][1];
  761. k.on(l) } }, _detachEvents: function() { for(var j = 0, k, l; j < this._events.length; j++) { k = this._events[j][0];
  762. l = this._events[j][1];
  763. k.off(l) } this._events = [] }, show: function(i) { this.picker.show();
  764. this.height = this.component ? this.component.outerHeight() : this.element.outerHeight(); if(this.forceParse) { this.update() } this.place();
  765. d(window).on("resize", d.proxy(this.place, this)); if(i) { i.stopPropagation();
  766. i.preventDefault() } this.isVisible = true;
  767. this.element.trigger({ type: "show", date: this.date }) }, hide: function() { if(!this.isVisible) { return } if(this.isInline) { return } this.picker.hide();
  768. d(window).off("resize", this.place);
  769. this.viewMode = this.startViewMode;
  770. this.showMode(); if(!this.isInput) { d(document).off("mousedown", this.hide) } if(this.forceParse && (this.isInput && this.element.val() || this.hasInput && this.element.find("input").val())) { this.setValue() } this.isVisible = false;
  771. this.element.trigger({ type: "hide", date: this.date }) }, remove: function() { this._detachEvents();
  772. d(document).off("mousedown", this.clickedOutside);
  773. this.picker.remove();
  774. delete this.picker;
  775. delete this.element.data().datetimepicker }, getDate: function() { var i = this.getUTCDate(); if(i === null) { return null } return new Date(i.getTime() + (i.getTimezoneOffset() * 60000)) }, getUTCDate: function() { return this.date }, getInitialDate: function() { return this.initialDate }, setInitialDate: function(i) { this.initialDate = i }, setDate: function(i) { this.setUTCDate(new Date(i.getTime() - (i.getTimezoneOffset() * 60000))) }, setUTCDate: function(i) { if(i >= this.startDate && i <= this.endDate) { this.date = i;
  776. this.setValue();
  777. this.viewDate = this.date;
  778. this.fill() } else { this.element.trigger({ type: "outOfRange", date: i, startDate: this.startDate, endDate: this.endDate }) } }, setFormat: function(j) { this.format = c.parseFormat(j, this.formatType); var i; if(this.isInput) { i = this.element } else { if(this.component) { i = this.element.find("input") } } if(i && i.val()) { this.setValue() } }, setValue: function() { var i = this.getFormattedDate(); if(!this.isInput) { if(this.component) { this.element.find("input").val(i) } this.element.data("date", i) } else { this.element.val(i) } if(this.linkField) { d("#" + this.linkField).val(this.getFormattedDate(this.linkFormat)) } }, getFormattedDate: function(i) { i = i || this.format; return c.formatDate(this.date, i, this.language, this.formatType, this.timezone) }, setStartDate: function(i) { this.startDate = i || this.startDate; if(this.startDate.valueOf() !== 8639968443048000) { this.startDate = c.parseDate(this.startDate, this.format, this.language, this.formatType, this.timezone) } this.update();
  779. this.updateNavArrows() }, setEndDate: function(i) { this.endDate = i || this.endDate; if(this.endDate.valueOf() !== 8639968443048000) { this.endDate = c.parseDate(this.endDate, this.format, this.language, this.formatType, this.timezone) } this.update();
  780. this.updateNavArrows() }, setDatesDisabled: function(j) { this.datesDisabled = j || []; if(!d.isArray(this.datesDisabled)) { this.datesDisabled = this.datesDisabled.split(/,\s*/) } var i = this;
  781. this.datesDisabled = d.map(this.datesDisabled, function(k) { return c.parseDate(k, i.format, i.language, i.formatType, i.timezone).toDateString() });
  782. this.update();
  783. this.updateNavArrows() }, setTitle: function(i, j) { return this.picker.find(i).find("th:eq(1)").text(this.title === false ? j : this.title) }, setDaysOfWeekDisabled: function(i) { this.daysOfWeekDisabled = i || []; if(!d.isArray(this.daysOfWeekDisabled)) { this.daysOfWeekDisabled = this.daysOfWeekDisabled.split(/,\s*/) } this.daysOfWeekDisabled = d.map(this.daysOfWeekDisabled, function(j) { return parseInt(j, 10) });
  784. this.update();
  785. this.updateNavArrows() }, setMinutesDisabled: function(i) { this.minutesDisabled = i || []; if(!d.isArray(this.minutesDisabled)) { this.minutesDisabled = this.minutesDisabled.split(/,\s*/) } this.minutesDisabled = d.map(this.minutesDisabled, function(j) { return parseInt(j, 10) });
  786. this.update();
  787. this.updateNavArrows() }, setHoursDisabled: function(i) { this.hoursDisabled = i || []; if(!d.isArray(this.hoursDisabled)) { this.hoursDisabled = this.hoursDisabled.split(/,\s*/) } this.hoursDisabled = d.map(this.hoursDisabled, function(j) { return parseInt(j, 10) });
  788. this.update();
  789. this.updateNavArrows() }, place: function() { if(this.isInline) { return } if(!this.zIndex) { var j = 0;
  790. d("div").each(function() { var o = parseInt(d(this).css("zIndex"), 10); if(o > j) { j = o } });
  791. this.zIndex = j + 10 } var n, m, l, k; if(this.container instanceof d) { k = this.container.offset() } else { k = d(this.container).offset() } if(this.component) { n = this.component.offset();
  792. l = n.left; if(this.pickerPosition === "bottom-left" || this.pickerPosition === "top-left") { l += this.component.outerWidth() - this.picker.outerWidth() } } else { n = this.element.offset();
  793. l = n.left; if(this.pickerPosition === "bottom-left" || this.pickerPosition === "top-left") { l += this.element.outerWidth() - this.picker.outerWidth() } } var i = document.body.clientWidth || window.innerWidth; if(l + 220 > i) { l = i - 220 } if(this.pickerPosition === "top-left" || this.pickerPosition === "top-right") { m = n.top - this.picker.outerHeight() } else { m = n.top + this.height } m = m - k.top;
  794. l = l - k.left;
  795. this.picker.css({ top: m, left: l, zIndex: this.zIndex }) }, update: function() { var i, j = false; if(arguments && arguments.length && (typeof arguments[0] === "string" || arguments[0] instanceof Date)) { i = arguments[0];
  796. j = true } else { i = (this.isInput ? this.element.val() : this.element.find("input").val()) || this.element.data("date") || this.initialDate; if(typeof i === "string") { i = i.replace(/^\s+|\s+$/g, "") } } if(!i) { i = new Date();
  797. j = false } this.date = c.parseDate(i, this.format, this.language, this.formatType, this.timezone); if(j) { this.setValue() } if(this.date < this.startDate) { this.viewDate = new Date(this.startDate) } else { if(this.date > this.endDate) { this.viewDate = new Date(this.endDate) } else { this.viewDate = new Date(this.date) } } this.fill() }, fillDow: function() { var i = this.weekStart,
  798. j = "<tr>"; while(i < this.weekStart + 7) { j += '<th class="dow">' + e[this.language].daysMin[(i++) % 7] + "</th>" } j += "</tr>";
  799. this.picker.find(".datetimepicker-days thead").append(j) }, fillMonths: function() { var l = ""; var m = new Date(this.viewDate); for(var k = 0; k < 12; k++) { m.setUTCMonth(k); var j = this.onRenderMonth(m);
  800. l += '<span class="' + j.join(" ") + '">' + e[this.language].monthsShort[k] + "</span>" } this.picker.find(".datetimepicker-months td").html(l) }, fill: function() { if(!this.date || !this.viewDate) { return } var E = new Date(this.viewDate),
  801. t = E.getUTCFullYear(),
  802. G = E.getUTCMonth(),
  803. n = E.getUTCDate(),
  804. A = E.getUTCHours(),
  805. w = this.startDate.getUTCFullYear(),
  806. B = this.startDate.getUTCMonth(),
  807. p = this.endDate.getUTCFullYear(),
  808. x = this.endDate.getUTCMonth() + 1,
  809. q = (new h(this.date.getUTCFullYear(), this.date.getUTCMonth(), this.date.getUTCDate())).valueOf(),
  810. D = new Date();
  811. this.setTitle(".datetimepicker-days", e[this.language].months[G] + " " + t); if(this.formatViewType === "time") { var k = this.getFormattedDate();
  812. this.setTitle(".datetimepicker-hours", k);
  813. this.setTitle(".datetimepicker-minutes", k) } else { this.setTitle(".datetimepicker-hours", n + " " + e[this.language].months[G] + " " + t);
  814. this.setTitle(".datetimepicker-minutes", n + " " + e[this.language].months[G] + " " + t) } this.picker.find("tfoot th.today").text(e[this.language].today || e.en.today).toggle(this.todayBtn !== false);
  815. this.picker.find("tfoot th.clear").text(e[this.language].clear || e.en.clear).toggle(this.clearBtn !== false);
  816. this.updateNavArrows();
  817. this.fillMonths(); var I = h(t, G - 1, 28, 0, 0, 0, 0),
  818. z = c.getDaysInMonth(I.getUTCFullYear(), I.getUTCMonth());
  819. I.setUTCDate(z);
  820. I.setUTCDate(z - (I.getUTCDay() - this.weekStart + 7) % 7); var j = new Date(I);
  821. j.setUTCDate(j.getUTCDate() + 42);
  822. j = j.valueOf(); var r = []; var F; while(I.valueOf() < j) { if(I.getUTCDay() === this.weekStart) { r.push("<tr>") } F = this.onRenderDay(I); if(I.getUTCFullYear() < t || (I.getUTCFullYear() === t && I.getUTCMonth() < G)) { F.push("old") } else { if(I.getUTCFullYear() > t || (I.getUTCFullYear() === t && I.getUTCMonth() > G)) { F.push("new") } } if(this.todayHighlight && I.getUTCFullYear() === D.getFullYear() && I.getUTCMonth() === D.getMonth() && I.getUTCDate() === D.getDate()) { F.push("today") } if(I.valueOf() === q) { F.push("active") } if((I.valueOf() + 86400000) <= this.startDate || I.valueOf() > this.endDate || d.inArray(I.getUTCDay(), this.daysOfWeekDisabled) !== -1 || d.inArray(I.toDateString(), this.datesDisabled) !== -1) { F.push("disabled") } r.push('<td class="' + F.join(" ") + '">' + I.getUTCDate() + "</td>"); if(I.getUTCDay() === this.weekEnd) { r.push("</tr>") } I.setUTCDate(I.getUTCDate() + 1) } this.picker.find(".datetimepicker-days tbody").empty().append(r.join(""));
  823. r = []; var u = "",
  824. C = "",
  825. s = ""; var l = this.hoursDisabled || [];
  826. E = new Date(this.viewDate); for(var y = 0; y < 24; y++) { E.setUTCHours(y);
  827. F = this.onRenderHour(E); if(l.indexOf(y) !== -1) { F.push("disabled") } var v = h(t, G, n, y); if((v.valueOf() + 3600000) <= this.startDate || v.valueOf() > this.endDate) { F.push("disabled") } else { if(A === y) { F.push("active") } } if(this.showMeridian && e[this.language].meridiem.length === 2) { C = (y < 12 ? e[this.language].meridiem[0] : e[this.language].meridiem[1]); if(C !== s) { if(s !== "") { r.push("</fieldset>") } r.push('<fieldset class="hour"><legend>' + C.toUpperCase() + "</legend>") } s = C;
  828. u = (y % 12 ? y % 12 : 12); if(y < 12) { F.push("hour_am") } else { F.push("hour_pm") } r.push('<span class="' + F.join(" ") + '">' + u + "</span>"); if(y === 23) { r.push("</fieldset>") } } else { u = y + ":00";
  829. r.push('<span class="' + F.join(" ") + '">' + u + "</span>") } } this.picker.find(".datetimepicker-hours td").html(r.join(""));
  830. r = [];
  831. u = "";
  832. C = "";
  833. s = ""; var m = this.minutesDisabled || [];
  834. E = new Date(this.viewDate); for(var y = 0; y < 60; y += this.minuteStep) { if(m.indexOf(y) !== -1) { continue } E.setUTCMinutes(y);
  835. E.setUTCSeconds(0);
  836. F = this.onRenderMinute(E); if(this.showMeridian && e[this.language].meridiem.length === 2) { C = (A < 12 ? e[this.language].meridiem[0] : e[this.language].meridiem[1]); if(C !== s) { if(s !== "") { r.push("</fieldset>") } r.push('<fieldset class="minute"><legend>' + C.toUpperCase() + "</legend>") } s = C;
  837. u = (A % 12 ? A % 12 : 12);
  838. r.push('<span class="' + F.join(" ") + '">' + u + ":" + (y < 10 ? "0" + y : y) + "</span>"); if(y === 59) { r.push("</fieldset>") } } else { u = y + ":00";
  839. r.push('<span class="' + F.join(" ") + '">' + A + ":" + (y < 10 ? "0" + y : y) + "</span>") } } this.picker.find(".datetimepicker-minutes td").html(r.join("")); var J = this.date.getUTCFullYear(); var o = this.setTitle(".datetimepicker-months", t).end().find(".month").removeClass("active"); if(J === t) { o.eq(this.date.getUTCMonth()).addClass("active") } if(t < w || t > p) { o.addClass("disabled") } if(t === w) { o.slice(0, B).addClass("disabled") } if(t === p) { o.slice(x).addClass("disabled") } r = "";
  840. t = parseInt(t / 10, 10) * 10; var H = this.setTitle(".datetimepicker-years", t + "-" + (t + 9)).end().find("td");
  841. t -= 1;
  842. E = new Date(this.viewDate); for(var y = -1; y < 11; y++) { E.setUTCFullYear(t);
  843. F = this.onRenderYear(E); if(y === -1 || y === 10) { F.push(b) } r += '<span class="' + F.join(" ") + '">' + t + "</span>";
  844. t += 1 } H.html(r);
  845. this.place() }, updateNavArrows: function() { var m = new Date(this.viewDate),
  846. k = m.getUTCFullYear(),
  847. l = m.getUTCMonth(),
  848. j = m.getUTCDate(),
  849. i = m.getUTCHours(); switch(this.viewMode) {
  850. case 0:
  851. if(k <= this.startDate.getUTCFullYear() && l <= this.startDate.getUTCMonth() && j <= this.startDate.getUTCDate() && i <= this.startDate.getUTCHours()) { this.picker.find(".prev").css({ visibility: "hidden" }) } else { this.picker.find(".prev").css({ visibility: "visible" }) } if(k >= this.endDate.getUTCFullYear() && l >= this.endDate.getUTCMonth() && j >= this.endDate.getUTCDate() && i >= this.endDate.getUTCHours()) { this.picker.find(".next").css({ visibility: "hidden" }) } else { this.picker.find(".next").css({ visibility: "visible" }) } break;
  852. case 1:
  853. if(k <= this.startDate.getUTCFullYear() && l <= this.startDate.getUTCMonth() && j <= this.startDate.getUTCDate()) { this.picker.find(".prev").css({ visibility: "hidden" }) } else { this.picker.find(".prev").css({ visibility: "visible" }) } if(k >= this.endDate.getUTCFullYear() && l >= this.endDate.getUTCMonth() && j >= this.endDate.getUTCDate()) { this.picker.find(".next").css({ visibility: "hidden" }) } else { this.picker.find(".next").css({ visibility: "visible" }) } break;
  854. case 2:
  855. if(k <= this.startDate.getUTCFullYear() && l <= this.startDate.getUTCMonth()) { this.picker.find(".prev").css({ visibility: "hidden" }) } else { this.picker.find(".prev").css({ visibility: "visible" }) } if(k >= this.endDate.getUTCFullYear() && l >= this.endDate.getUTCMonth()) { this.picker.find(".next").css({ visibility: "hidden" }) } else { this.picker.find(".next").css({ visibility: "visible" }) } break;
  856. case 3:
  857. case 4:
  858. if(k <= this.startDate.getUTCFullYear()) { this.picker.find(".prev").css({ visibility: "hidden" }) } else { this.picker.find(".prev").css({ visibility: "visible" }) } if(k >= this.endDate.getUTCFullYear()) { this.picker.find(".next").css({ visibility: "hidden" }) } else { this.picker.find(".next").css({ visibility: "visible" }) } break } }, mousewheel: function(j) { j.preventDefault();
  859. j.stopPropagation(); if(this.wheelPause) { return } this.wheelPause = true; var i = j.originalEvent; var l = i.wheelDelta; var k = l > 0 ? 1 : (l === 0) ? 0 : -1; if(this.wheelViewModeNavigationInverseDirection) { k = -k } this.showMode(k);
  860. setTimeout(d.proxy(function() { this.wheelPause = false }, this), this.wheelViewModeNavigationDelay) }, click: function(m) { m.stopPropagation();
  861. m.preventDefault(); var n = d(m.target).closest("span, td, th, legend"); if(n.is("." + this.icontype)) { n = d(n).parent().closest("span, td, th, legend") } if(n.length === 1) { if(n.is(".disabled")) { this.element.trigger({ type: "outOfRange", date: this.viewDate, startDate: this.startDate, endDate: this.endDate }); return } switch(n[0].nodeName.toLowerCase()) {
  862. case "th":
  863. switch(n[0].className) {
  864. case "switch":
  865. this.showMode(1); break;
  866. case "prev":
  867. case "next":
  868. var i = c.modes[this.viewMode].navStep * (n[0].className === "prev" ? -1 : 1); switch(this.viewMode) {
  869. case 0:
  870. this.viewDate = this.moveHour(this.viewDate, i); break;
  871. case 1:
  872. this.viewDate = this.moveDate(this.viewDate, i); break;
  873. case 2:
  874. this.viewDate = this.moveMonth(this.viewDate, i); break;
  875. case 3:
  876. case 4:
  877. this.viewDate = this.moveYear(this.viewDate, i); break } this.fill();
  878. this.element.trigger({ type: n[0].className + ":" + this.convertViewModeText(this.viewMode), date: this.viewDate, startDate: this.startDate, endDate: this.endDate }); break;
  879. case "clear":
  880. this.reset(); if(this.autoclose) { this.hide() } break;
  881. case "today":
  882. var j = new Date();
  883. j = h(j.getFullYear(), j.getMonth(), j.getDate(), j.getHours(), j.getMinutes(), j.getSeconds(), 0); if(j < this.startDate) { j = this.startDate } else { if(j > this.endDate) { j = this.endDate } } this.viewMode = this.startViewMode;
  884. this.showMode(0);
  885. this._setDate(j);
  886. this.fill(); if(this.autoclose) { this.hide() } break } break;
  887. case "span":
  888. if(!n.is(".disabled")) { var p = this.viewDate.getUTCFullYear(),
  889. o = this.viewDate.getUTCMonth(),
  890. q = this.viewDate.getUTCDate(),
  891. r = this.viewDate.getUTCHours(),
  892. k = this.viewDate.getUTCMinutes(),
  893. s = this.viewDate.getUTCSeconds(); if(n.is(".month")) { this.viewDate.setUTCDate(1);
  894. o = n.parent().find("span").index(n);
  895. q = this.viewDate.getUTCDate();
  896. this.viewDate.setUTCMonth(o);
  897. this.element.trigger({ type: "changeMonth", date: this.viewDate }); if(this.viewSelect >= 3) { this._setDate(h(p, o, q, r, k, s, 0)) } } else { if(n.is(".year")) { this.viewDate.setUTCDate(1);
  898. p = parseInt(n.text(), 10) || 0;
  899. this.viewDate.setUTCFullYear(p);
  900. this.element.trigger({ type: "changeYear", date: this.viewDate }); if(this.viewSelect >= 4) { this._setDate(h(p, o, q, r, k, s, 0)) } } else { if(n.is(".hour")) { r = parseInt(n.text(), 10) || 0; if(n.hasClass("hour_am") || n.hasClass("hour_pm")) { if(r === 12 && n.hasClass("hour_am")) { r = 0 } else { if(r !== 12 && n.hasClass("hour_pm")) { r += 12 } } } this.viewDate.setUTCHours(r);
  901. this.element.trigger({ type: "changeHour", date: this.viewDate }); if(this.viewSelect >= 1) { this._setDate(h(p, o, q, r, k, s, 0)) } } else { if(n.is(".minute")) { k = parseInt(n.text().substr(n.text().indexOf(":") + 1), 10) || 0;
  902. this.viewDate.setUTCMinutes(k);
  903. this.element.trigger({ type: "changeMinute", date: this.viewDate }); if(this.viewSelect >= 0) { this._setDate(h(p, o, q, r, k, s, 0)) } } } } } if(this.viewMode !== 0) { var l = this.viewMode;
  904. this.showMode(-1);
  905. this.fill(); if(l === this.viewMode && this.autoclose) { this.hide() } } else { this.fill(); if(this.autoclose) { this.hide() } } } break;
  906. case "td":
  907. if(n.is(".day") && !n.is(".disabled")) { var q = parseInt(n.text(), 10) || 1; var p = this.viewDate.getUTCFullYear(),
  908. o = this.viewDate.getUTCMonth(),
  909. r = this.viewDate.getUTCHours(),
  910. k = this.viewDate.getUTCMinutes(),
  911. s = this.viewDate.getUTCSeconds(); if(n.is(".old")) { if(o === 0) { o = 11;
  912. p -= 1 } else { o -= 1 } } else { if(n.is(".new")) { if(o === 11) { o = 0;
  913. p += 1 } else { o += 1 } } } this.viewDate.setUTCFullYear(p);
  914. this.viewDate.setUTCMonth(o, q);
  915. this.element.trigger({ type: "changeDay", date: this.viewDate }); if(this.viewSelect >= 2) { this._setDate(h(p, o, q, r, k, s, 0)) } } var l = this.viewMode;
  916. this.showMode(-1);
  917. this.fill(); if(l === this.viewMode && this.autoclose) { this.hide() } break } } }, _setDate: function(i, k) { if(!k || k === "date") { this.date = i } if(!k || k === "view") { this.viewDate = i } this.fill();
  918. this.setValue(); var j; if(this.isInput) { j = this.element } else { if(this.component) { j = this.element.find("input") } } if(j) { j.change() } this.element.trigger({ type: "changeDate", date: this.getDate() }); if(i === null) { this.date = this.viewDate } }, moveMinute: function(j, i) { if(!i) { return j } var k = new Date(j.valueOf());
  919. k.setUTCMinutes(k.getUTCMinutes() + (i * this.minuteStep)); return k }, moveHour: function(j, i) { if(!i) { return j } var k = new Date(j.valueOf());
  920. k.setUTCHours(k.getUTCHours() + i); return k }, moveDate: function(j, i) { if(!i) { return j } var k = new Date(j.valueOf());
  921. k.setUTCDate(k.getUTCDate() + i); return k }, moveMonth: function(j, k) { if(!k) { return j } var n = new Date(j.valueOf()),
  922. r = n.getUTCDate(),
  923. o = n.getUTCMonth(),
  924. m = Math.abs(k),
  925. q, p;
  926. k = k > 0 ? 1 : -1; if(m === 1) { p = k === -1 ? function() { return n.getUTCMonth() === o } : function() { return n.getUTCMonth() !== q };
  927. q = o + k;
  928. n.setUTCMonth(q); if(q < 0 || q > 11) { q = (q + 12) % 12 } } else { for(var l = 0; l < m; l++) { n = this.moveMonth(n, k) } q = n.getUTCMonth();
  929. n.setUTCDate(r);
  930. p = function() { return q !== n.getUTCMonth() } } while(p()) { n.setUTCDate(--r);
  931. n.setUTCMonth(q) } return n }, moveYear: function(j, i) { return this.moveMonth(j, i * 12) }, dateWithinRange: function(i) { return i >= this.startDate && i <= this.endDate }, keydown: function(o) { if(this.picker.is(":not(:visible)")) { if(o.keyCode === 27) { this.show() } return } var k = false,
  932. j, i, n; switch(o.keyCode) {
  933. case 27:
  934. this.hide();
  935. o.preventDefault(); break;
  936. case 37:
  937. case 39:
  938. if(!this.keyboardNavigation) { break } j = o.keyCode === 37 ? -1 : 1; var m = this.viewMode; if(o.ctrlKey) { m += 2 } else { if(o.shiftKey) { m += 1 } } if(m === 4) { i = this.moveYear(this.date, j);
  939. n = this.moveYear(this.viewDate, j) } else { if(m === 3) { i = this.moveMonth(this.date, j);
  940. n = this.moveMonth(this.viewDate, j) } else { if(m === 2) { i = this.moveDate(this.date, j);
  941. n = this.moveDate(this.viewDate, j) } else { if(m === 1) { i = this.moveHour(this.date, j);
  942. n = this.moveHour(this.viewDate, j) } else { if(m === 0) { i = this.moveMinute(this.date, j);
  943. n = this.moveMinute(this.viewDate, j) } } } } } if(this.dateWithinRange(i)) { this.date = i;
  944. this.viewDate = n;
  945. this.setValue();
  946. this.update();
  947. o.preventDefault();
  948. k = true } break;
  949. case 38:
  950. case 40:
  951. if(!this.keyboardNavigation) { break } j = o.keyCode === 38 ? -1 : 1;
  952. m = this.viewMode; if(o.ctrlKey) { m += 2 } else { if(o.shiftKey) { m += 1 } } if(m === 4) { i = this.moveYear(this.date, j);
  953. n = this.moveYear(this.viewDate, j) } else { if(m === 3) { i = this.moveMonth(this.date, j);
  954. n = this.moveMonth(this.viewDate, j) } else { if(m === 2) { i = this.moveDate(this.date, j * 7);
  955. n = this.moveDate(this.viewDate, j * 7) } else { if(m === 1) { if(this.showMeridian) { i = this.moveHour(this.date, j * 6);
  956. n = this.moveHour(this.viewDate, j * 6) } else { i = this.moveHour(this.date, j * 4);
  957. n = this.moveHour(this.viewDate, j * 4) } } else { if(m === 0) { i = this.moveMinute(this.date, j * 4);
  958. n = this.moveMinute(this.viewDate, j * 4) } } } } } if(this.dateWithinRange(i)) { this.date = i;
  959. this.viewDate = n;
  960. this.setValue();
  961. this.update();
  962. o.preventDefault();
  963. k = true } break;
  964. case 13:
  965. if(this.viewMode !== 0) { var p = this.viewMode;
  966. this.showMode(-1);
  967. this.fill(); if(p === this.viewMode && this.autoclose) { this.hide() } } else { this.fill(); if(this.autoclose) { this.hide() } } o.preventDefault(); break;
  968. case 9:
  969. this.hide(); break } if(k) { var l; if(this.isInput) { l = this.element } else { if(this.component) { l = this.element.find("input") } } if(l) { l.change() } this.element.trigger({ type: "changeDate", date: this.getDate() }) } }, showMode: function(i) { if(i) { var j = Math.max(0, Math.min(c.modes.length - 1, this.viewMode + i)); if(j >= this.minView && j <= this.maxView) { this.element.trigger({ type: "changeMode", date: this.viewDate, oldViewMode: this.viewMode, newViewMode: j });
  970. this.viewMode = j } } this.picker.find(">div").hide().filter(".datetimepicker-" + c.modes[this.viewMode].clsName).css("display", "block");
  971. this.updateNavArrows() }, reset: function() { this._setDate(null, "date") }, convertViewModeText: function(i) { switch(i) {
  972. case 4:
  973. return "decade";
  974. case 3:
  975. return "year";
  976. case 2:
  977. return "month";
  978. case 1:
  979. return "day";
  980. case 0:
  981. return "hour" } } }; var b = d.fn.datetimepicker;
  982. d.fn.datetimepicker = function(k) { var i = Array.apply(null, arguments);
  983. i.shift(); var j;
  984. this.each(function() { var n = d(this),
  985. m = n.data("datetimepicker"),
  986. l = typeof k === "object" && k; if(!m) { n.data("datetimepicker", (m = new g(this, d.extend({}, d.fn.datetimepicker.defaults, l)))) } if(typeof k === "string" && typeof m[k] === "function") { j = m[k].apply(m, i); if(j !== f) { return false } } }); if(j !== f) { return j } else { return this } };
  987. d.fn.datetimepicker.defaults = {};
  988. d.fn.datetimepicker.Constructor = g; var e = d.fn.datetimepicker.dates = { en: { days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"], months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], meridiem: ["am", "pm"], suffix: ["st", "nd", "rd", "th"], today: "Today", clear: "Clear" } }; var c = { modes: [{ clsName: "minutes", navFnc: "Hours", navStep: 1 }, { clsName: "hours", navFnc: "Date", navStep: 1 }, { clsName: "days", navFnc: "Month", navStep: 1 }, { clsName: "months", navFnc: "FullYear", navStep: 1 }, { clsName: "years", navFnc: "FullYear", navStep: 10 }], isLeapYear: function(i) { return(((i % 4 === 0) && (i % 100 !== 0)) || (i % 400 === 0)) }, getDaysInMonth: function(i, j) { return [31, (c.isLeapYear(i) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][j] }, getDefaultFormat: function(i, j) { if(i === "standard") { if(j === "input") { return "yyyy-mm-dd hh:ii" } else { return "yyyy-mm-dd hh:ii:ss" } } else { if(i === "php") { if(j === "input") { return "Y-m-d H:i" } else { return "Y-m-d H:i:s" } } else { throw new Error("Invalid format type.") } } }, validParts: function(i) { if(i === "standard") { return /t|hh?|HH?|p|P|z|Z|ii?|ss?|dd?|DD?|mm?|MM?|yy(?:yy)?/g } else { if(i === "php") { return /[dDjlNwzFmMnStyYaABgGhHis]/g } else { throw new Error("Invalid format type.") } } }, nonpunctuation: /[^ -\/:-@\[-`{-~\t\n\rTZ]+/g, parseFormat: function(l, j) { var i = l.replace(this.validParts(j), "\0").split("\0"),
  989. k = l.match(this.validParts(j)); if(!i || !i.length || !k || k.length === 0) { throw new Error("Invalid date format.") } return { separators: i, parts: k } }, parseDate: function(A, y, v, j, r) { if(A instanceof Date) { var u = new Date(A.valueOf() - A.getTimezoneOffset() * 60000);
  990. u.setMilliseconds(0); return u } if(/^\d{4}\-\d{1,2}\-\d{1,2}$/.test(A)) { y = this.parseFormat("yyyy-mm-dd", j) } if(/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}$/.test(A)) { y = this.parseFormat("yyyy-mm-dd hh:ii", j) } if(/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}\:\d{1,2}[Z]{0,1}$/.test(A)) { y = this.parseFormat("yyyy-mm-dd hh:ii:ss", j) } if(/^[-+]\d+[dmwy]([\s,]+[-+]\d+[dmwy])*$/.test(A)) { var l = /([-+]\d+)([dmwy])/,
  991. q = A.match(/([-+]\d+)([dmwy])/g),
  992. t, p;
  993. A = new Date(); for(var x = 0; x < q.length; x++) { t = l.exec(q[x]);
  994. p = parseInt(t[1]); switch(t[2]) {
  995. case "d":
  996. A.setUTCDate(A.getUTCDate() + p); break;
  997. case "m":
  998. A = g.prototype.moveMonth.call(g.prototype, A, p); break;
  999. case "w":
  1000. A.setUTCDate(A.getUTCDate() + p * 7); break;
  1001. case "y":
  1002. A = g.prototype.moveYear.call(g.prototype, A, p); break } } return h(A.getUTCFullYear(), A.getUTCMonth(), A.getUTCDate(), A.getUTCHours(), A.getUTCMinutes(), A.getUTCSeconds(), 0) } var q = A && A.toString().match(this.nonpunctuation) || [],
  1003. A = new Date(0, 0, 0, 0, 0, 0, 0),
  1004. m = {},
  1005. z = ["hh", "h", "ii", "i", "ss", "s", "yyyy", "yy", "M", "MM", "m", "mm", "D", "DD", "d", "dd", "H", "HH", "p", "P", "z", "Z"],
  1006. o = { hh: function(s, i) { return s.setUTCHours(i) }, h: function(s, i) { return s.setUTCHours(i) }, HH: function(s, i) { return s.setUTCHours(i === 12 ? 0 : i) }, H: function(s, i) { return s.setUTCHours(i === 12 ? 0 : i) }, ii: function(s, i) { return s.setUTCMinutes(i) }, i: function(s, i) { return s.setUTCMinutes(i) }, ss: function(s, i) { return s.setUTCSeconds(i) }, s: function(s, i) { return s.setUTCSeconds(i) }, yyyy: function(s, i) { return s.setUTCFullYear(i) }, yy: function(s, i) { return s.setUTCFullYear(2000 + i) }, m: function(s, i) { i -= 1; while(i < 0) { i += 12 } i %= 12;
  1007. s.setUTCMonth(i); while(s.getUTCMonth() !== i) { if(isNaN(s.getUTCMonth())) { return s } else { s.setUTCDate(s.getUTCDate() - 1) } } return s }, d: function(s, i) { return s.setUTCDate(i) }, p: function(s, i) { return s.setUTCHours(i === 1 ? s.getUTCHours() + 12 : s.getUTCHours()) }, z: function() { return r } },
  1008. B, k, t;
  1009. o.M = o.MM = o.mm = o.m;
  1010. o.dd = o.d;
  1011. o.P = o.p;
  1012. o.Z = o.z;
  1013. A = h(A.getFullYear(), A.getMonth(), A.getDate(), A.getHours(), A.getMinutes(), A.getSeconds()); if(q.length === y.parts.length) { for(var x = 0, w = y.parts.length; x < w; x++) { B = parseInt(q[x], 10);
  1014. t = y.parts[x]; if(isNaN(B)) { switch(t) {
  1015. case "MM":
  1016. k = d(e[v].months).filter(function() { var i = this.slice(0, q[x].length),
  1017. s = q[x].slice(0, i.length); return i === s });
  1018. B = d.inArray(k[0], e[v].months) + 1; break;
  1019. case "M":
  1020. k = d(e[v].monthsShort).filter(function() { var i = this.slice(0, q[x].length),
  1021. s = q[x].slice(0, i.length); return i.toLowerCase() === s.toLowerCase() });
  1022. B = d.inArray(k[0], e[v].monthsShort) + 1; break;
  1023. case "p":
  1024. case "P":
  1025. B = d.inArray(q[x].toLowerCase(), e[v].meridiem); break;
  1026. case "z":
  1027. case "Z":
  1028. r; break } } m[t] = B } for(var x = 0, n; x < z.length; x++) { n = z[x]; if(n in m && !isNaN(m[n])) { o[n](A, m[n]) } } } return A }, formatDate: function(l, q, m, p, o) { if(l === null) { return "" } var k; if(p === "standard") { k = { t: l.getTime(), yy: l.getUTCFullYear().toString().substring(2), yyyy: l.getUTCFullYear(), m: l.getUTCMonth() + 1, M: e[m].monthsShort[l.getUTCMonth()], MM: e[m].months[l.getUTCMonth()], d: l.getUTCDate(), D: e[m].daysShort[l.getUTCDay()], DD: e[m].days[l.getUTCDay()], p: (e[m].meridiem.length === 2 ? e[m].meridiem[l.getUTCHours() < 12 ? 0 : 1] : ""), h: l.getUTCHours(), i: l.getUTCMinutes(), s: l.getUTCSeconds(), z: o }; if(e[m].meridiem.length === 2) { k.H = (k.h % 12 === 0 ? 12 : k.h % 12) } else { k.H = k.h } k.HH = (k.H < 10 ? "0" : "") + k.H;
  1029. k.P = k.p.toUpperCase();
  1030. k.Z = k.z;
  1031. k.hh = (k.h < 10 ? "0" : "") + k.h;
  1032. k.ii = (k.i < 10 ? "0" : "") + k.i;
  1033. k.ss = (k.s < 10 ? "0" : "") + k.s;
  1034. k.dd = (k.d < 10 ? "0" : "") + k.d;
  1035. k.mm = (k.m < 10 ? "0" : "") + k.m } else { if(p === "php") { k = { y: l.getUTCFullYear().toString().substring(2), Y: l.getUTCFullYear(), F: e[m].months[l.getUTCMonth()], M: e[m].monthsShort[l.getUTCMonth()], n: l.getUTCMonth() + 1, t: c.getDaysInMonth(l.getUTCFullYear(), l.getUTCMonth()), j: l.getUTCDate(), l: e[m].days[l.getUTCDay()], D: e[m].daysShort[l.getUTCDay()], w: l.getUTCDay(), N: (l.getUTCDay() === 0 ? 7 : l.getUTCDay()), S: (l.getUTCDate() % 10 <= e[m].suffix.length ? e[m].suffix[l.getUTCDate() % 10 - 1] : ""), a: (e[m].meridiem.length === 2 ? e[m].meridiem[l.getUTCHours() < 12 ? 0 : 1] : ""), g: (l.getUTCHours() % 12 === 0 ? 12 : l.getUTCHours() % 12), G: l.getUTCHours(), i: l.getUTCMinutes(), s: l.getUTCSeconds() };
  1036. k.m = (k.n < 10 ? "0" : "") + k.n;
  1037. k.d = (k.j < 10 ? "0" : "") + k.j;
  1038. k.A = k.a.toString().toUpperCase();
  1039. k.h = (k.g < 10 ? "0" : "") + k.g;
  1040. k.H = (k.G < 10 ? "0" : "") + k.G;
  1041. k.i = (k.i < 10 ? "0" : "") + k.i;
  1042. k.s = (k.s < 10 ? "0" : "") + k.s } else { throw new Error("Invalid format type.") } } var l = [],
  1043. r = d.extend([], q.separators); for(var n = 0, j = q.parts.length; n < j; n++) { if(r.length) { l.push(r.shift()) } l.push(k[q.parts[n]]) } if(r.length) { l.push(r.shift()) } return l.join("") }, convertViewMode: function(i) { switch(i) {
  1044. case 4:
  1045. case "decade":
  1046. i = 4; break;
  1047. case 3:
  1048. case "year":
  1049. i = 3; break;
  1050. case 2:
  1051. case "month":
  1052. i = 2; break;
  1053. case 1:
  1054. case "day":
  1055. i = 1; break;
  1056. case 0:
  1057. case "hour":
  1058. i = 0; break } return i }, headTemplate: '<thead><tr><th class="prev"><i class="{iconType} {leftArrow}"/></th><th colspan="5" class="switch"></th><th class="next"><i class="{iconType} {rightArrow}"/></th></tr></thead>', headTemplateV3: '<thead><tr><th class="prev"><span class="{iconType} {leftArrow}"></span> </th><th colspan="5" class="switch"></th><th class="next"><span class="{iconType} {rightArrow}"></span> </th></tr></thead>', contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>', footTemplate: '<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>' };
  1059. c.template = '<div class="datetimepicker"><div class="datetimepicker-minutes"><table class=" table-condensed">' + c.headTemplate + c.contTemplate + c.footTemplate + '</table></div><div class="datetimepicker-hours"><table class=" table-condensed">' + c.headTemplate + c.contTemplate + c.footTemplate + '</table></div><div class="datetimepicker-days"><table class=" table-condensed">' + c.headTemplate + "<tbody></tbody>" + c.footTemplate + '</table></div><div class="datetimepicker-months"><table class="table-condensed">' + c.headTemplate + c.contTemplate + c.footTemplate + '</table></div><div class="datetimepicker-years"><table class="table-condensed">' + c.headTemplate + c.contTemplate + c.footTemplate + "</table></div></div>";
  1060. c.templateV3 = '<div class="datetimepicker"><div class="datetimepicker-minutes"><table class=" table-condensed">' + c.headTemplateV3 + c.contTemplate + c.footTemplate + '</table></div><div class="datetimepicker-hours"><table class=" table-condensed">' + c.headTemplateV3 + c.contTemplate + c.footTemplate + '</table></div><div class="datetimepicker-days"><table class=" table-condensed">' + c.headTemplateV3 + "<tbody></tbody>" + c.footTemplate + '</table></div><div class="datetimepicker-months"><table class="table-condensed">' + c.headTemplateV3 + c.contTemplate + c.footTemplate + '</table></div><div class="datetimepicker-years"><table class="table-condensed">' + c.headTemplateV3 + c.contTemplate + c.footTemplate + "</table></div></div>";
  1061. d.fn.datetimepicker.DPGlobal = c;
  1062. d.fn.datetimepicker.noConflict = function() { d.fn.datetimepicker = b; return this };
  1063. d(document).on("focus.datetimepicker.data-api click.datetimepicker.data-api", '[data-provide="datetimepicker"]', function(j) { var i = d(this); if(i.data("datetimepicker")) { return } j.preventDefault();
  1064. i.datetimepicker("show") });
  1065. d(function() { d('[data-provide="datetimepicker-inline"]').datetimepicker() }) }));