You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

854 lines
48 KiB

4 years ago
  1. /*!
  2. * Datepicker for Bootstrap v1.7.0-dev (https://github.com/eternicode/bootstrap-datepicker)
  3. *
  4. * Copyright 2012 Stefan Petre
  5. * Improvements by Andrew Rowls
  6. * Licensed under the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0)
  7. */
  8. ! function (a) {
  9. "function" == typeof define && define.amd ? define(["jquery"], a) : a("object" == typeof exports ? require("jquery") : jQuery)
  10. }(function (a, b) {
  11. function c() {
  12. return new Date(Date.UTC.apply(Date, arguments))
  13. }
  14. function d() {
  15. var a = new Date;
  16. return c(a.getFullYear(), a.getMonth(), a.getDate())
  17. }
  18. function e(a, b) {
  19. return a.getUTCFullYear() === b.getUTCFullYear() && a.getUTCMonth() === b.getUTCMonth() && a.getUTCDate() === b.getUTCDate()
  20. }
  21. function f(a) {
  22. return function () {
  23. return this[a].apply(this, arguments)
  24. }
  25. }
  26. function g(a) {
  27. return a && !isNaN(a.getTime())
  28. }
  29. function h(b, c) {
  30. function d(a, b) {
  31. return b.toLowerCase()
  32. }
  33. var e, f = a(b).data(),
  34. g = {},
  35. h = new RegExp("^" + c.toLowerCase() + "([A-Z])");
  36. c = new RegExp("^" + c.toLowerCase());
  37. for (var i in f) c.test(i) && (e = i.replace(h, d), g[e] = f[i]);
  38. return g
  39. }
  40. function i(b) {
  41. var c = {};
  42. if (q[b] || (b = b.split("-")[0], q[b])) {
  43. var d = q[b];
  44. return a.each(p, function (a, b) {
  45. b in d && (c[b] = d[b])
  46. }), c
  47. }
  48. }
  49. var j = function () {
  50. var b = {
  51. get: function (a) {
  52. return this.slice(a)[0]
  53. },
  54. contains: function (a) {
  55. for (var b = a && a.valueOf(), c = 0, d = this.length; d > c; c++)
  56. if (0 <= this[c].valueOf() - b && this[c].valueOf() - b < 864e5) return c;
  57. return -1
  58. },
  59. remove: function (a) {
  60. this.splice(a, 1)
  61. },
  62. replace: function (b) {
  63. b && (a.isArray(b) || (b = [b]), this.clear(), this.push.apply(this, b))
  64. },
  65. clear: function () {
  66. this.length = 0
  67. },
  68. copy: function () {
  69. var a = new j;
  70. return a.replace(this), a
  71. }
  72. };
  73. return function () {
  74. var c = [];
  75. return c.push.apply(c, arguments), a.extend(c, b), c
  76. }
  77. }(),
  78. k = function (b, c) {
  79. a.data(b, "datepicker", this), this._process_options(c), this.dates = new j, this.viewDate = this.o.defaultViewDate, this.focusDate = null, this.element = a(b), this.isInput = this.element.is("input"), this.inputField = this.isInput ? this.element : this.element.find("input"), this.component = this.element.hasClass("date") ? this.element.find(".add-on, .input-group-addon, .btn") : !1, this.component && 0 === this.component.length && (this.component = !1), this.isInline = !this.component && this.element.is("div"), this.picker = a(r.template), this._check_template(this.o.templates.leftArrow) && this.picker.find(".prev").html(this.o.templates.leftArrow), this._check_template(this.o.templates.rightArrow) && this.picker.find(".next").html(this.o.templates.rightArrow), this._buildEvents(), this._attachEvents(), this.isInline ? this.picker.addClass("datepicker-inline").appendTo(this.element) : this.picker.addClass("datepicker-dropdown dropdown-menu"), this.o.rtl && this.picker.addClass("datepicker-rtl"), this.o.calendarWeeks && this.picker.find(".datepicker-days .datepicker-switch, thead .datepicker-title, tfoot .today, tfoot .clear").attr("colspan", function (a, b) {
  80. return Number(b) + 1
  81. }), this._allow_update = !1, this.setStartDate(this._o.startDate), this.setEndDate(this._o.endDate), this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled), this.setDaysOfWeekHighlighted(this.o.daysOfWeekHighlighted), this.setDatesDisabled(this.o.datesDisabled), this.setViewMode(this.o.startView), this.fillDow(), this.fillMonths(), this._allow_update = !0, this.update(), this.isInline && this.show()
  82. };
  83. k.prototype = {
  84. constructor: k,
  85. _resolveViewName: function (b) {
  86. return a.each(r.viewModes, function (c, d) {
  87. return b === c || -1 !== a.inArray(b, d.names) ? (b = c, !1) : void 0
  88. }), b
  89. },
  90. _resolveDaysOfWeek: function (b) {
  91. return a.isArray(b) || (b = b.split(/[,\s]*/)), a.map(b, Number)
  92. },
  93. _check_template: function (c) {
  94. try {
  95. if (c === b || "" === c) return !1;
  96. if ((c.match(/[<>]/g) || []).length <= 0) return !0;
  97. var d = a(c);
  98. return d.length > 0
  99. } catch (e) {
  100. return !1
  101. }
  102. },
  103. _process_options: function (b) {
  104. this._o = a.extend({}, this._o, b);
  105. var e = this.o = a.extend({}, this._o),
  106. f = e.language;
  107. q[f] || (f = f.split("-")[0], q[f] || (f = o.language)), e.language = f, e.startView = this._resolveViewName(e.startView), e.minViewMode = this._resolveViewName(e.minViewMode), e.maxViewMode = this._resolveViewName(e.maxViewMode), e.startView = Math.max(this.o.minViewMode, Math.min(this.o.maxViewMode, e.startView)), e.multidate !== !0 && (e.multidate = Number(e.multidate) || !1, e.multidate !== !1 && (e.multidate = Math.max(0, e.multidate))), e.multidateSeparator = String(e.multidateSeparator), e.weekStart %= 7, e.weekEnd = (e.weekStart + 6) % 7;
  108. var g = r.parseFormat(e.format);
  109. e.startDate !== -(1 / 0) && (e.startDate ? e.startDate instanceof Date ? e.startDate = this._local_to_utc(this._zero_time(e.startDate)) : e.startDate = r.parseDate(e.startDate, g, e.language, e.assumeNearbyYear) : e.startDate = -(1 / 0)), e.endDate !== 1 / 0 && (e.endDate ? e.endDate instanceof Date ? e.endDate = this._local_to_utc(this._zero_time(e.endDate)) : e.endDate = r.parseDate(e.endDate, g, e.language, e.assumeNearbyYear) : e.endDate = 1 / 0), e.daysOfWeekDisabled = this._resolveDaysOfWeek(e.daysOfWeekDisabled || []), e.daysOfWeekHighlighted = this._resolveDaysOfWeek(e.daysOfWeekHighlighted || []), e.datesDisabled = e.datesDisabled || [], a.isArray(e.datesDisabled) || (e.datesDisabled = [e.datesDisabled]), e.datesDisabled = a.map(e.datesDisabled, function (a) {
  110. return r.parseDate(a, g, e.language, e.assumeNearbyYear)
  111. });
  112. var h = String(e.orientation).toLowerCase().split(/\s+/g),
  113. i = e.orientation.toLowerCase();
  114. if (h = a.grep(h, function (a) {
  115. return /^auto|left|right|top|bottom$/.test(a)
  116. }), e.orientation = {
  117. x: "auto",
  118. y: "auto"
  119. }, i && "auto" !== i)
  120. if (1 === h.length) switch (h[0]) {
  121. case "top":
  122. case "bottom":
  123. e.orientation.y = h[0];
  124. break;
  125. case "left":
  126. case "right":
  127. e.orientation.x = h[0]
  128. } else i = a.grep(h, function (a) {
  129. return /^left|right$/.test(a)
  130. }), e.orientation.x = i[0] || "auto", i = a.grep(h, function (a) {
  131. return /^top|bottom$/.test(a)
  132. }), e.orientation.y = i[0] || "auto";
  133. else;
  134. if (e.defaultViewDate) {
  135. var j = e.defaultViewDate.year || (new Date).getFullYear(),
  136. k = e.defaultViewDate.month || 0,
  137. l = e.defaultViewDate.day || 1;
  138. e.defaultViewDate = c(j, k, l)
  139. } else e.defaultViewDate = d()
  140. },
  141. _events: [],
  142. _secondaryEvents: [],
  143. _applyEvents: function (a) {
  144. for (var c, d, e, f = 0; f < a.length; f++) c = a[f][0], 2 === a[f].length ? (d = b, e = a[f][1]) : 3 === a[f].length && (d = a[f][1], e = a[f][2]), c.on(e, d)
  145. },
  146. _unapplyEvents: function (a) {
  147. for (var c, d, e, f = 0; f < a.length; f++) c = a[f][0], 2 === a[f].length ? (e = b, d = a[f][1]) : 3 === a[f].length && (e = a[f][1], d = a[f][2]), c.off(d, e)
  148. },
  149. _buildEvents: function () {
  150. var b = {
  151. keyup: a.proxy(function (b) {
  152. -1 === a.inArray(b.keyCode, [27, 37, 39, 38, 40, 32, 13, 9]) && this.update()
  153. }, this),
  154. keydown: a.proxy(this.keydown, this),
  155. paste: a.proxy(this.paste, this)
  156. };
  157. this.o.showOnFocus === !0 && (b.focus = a.proxy(this.show, this)), this.isInput ? this._events = [
  158. [this.element, b]
  159. ] : this.component && this.inputField.length ? this._events = [
  160. [this.inputField, b],
  161. [this.component, {
  162. click: a.proxy(this.show, this)
  163. }]
  164. ] : this._events = [
  165. [this.element, {
  166. click: a.proxy(this.show, this),
  167. keydown: a.proxy(this.keydown, this)
  168. }]
  169. ], this._events.push([this.element, "*", {
  170. blur: a.proxy(function (a) {
  171. this._focused_from = a.target
  172. }, this)
  173. }], [this.element, {
  174. blur: a.proxy(function (a) {
  175. this._focused_from = a.target
  176. }, this)
  177. }]), this.o.immediateUpdates && this._events.push([this.element, {
  178. "changeYear changeMonth": a.proxy(function (a) {
  179. this.update(a.date)
  180. }, this)
  181. }]), this._secondaryEvents = [
  182. [this.picker, {
  183. click: a.proxy(this.click, this)
  184. }],
  185. [this.picker, ".prev, .next", {
  186. click: a.proxy(this.navArrowsClick, this)
  187. }],
  188. [a(window), {
  189. resize: a.proxy(this.place, this)
  190. }],
  191. [a(document), {
  192. "mousedown touchstart": a.proxy(function (a) {
  193. this.element.is(a.target) || this.element.find(a.target).length || this.picker.is(a.target) || this.picker.find(a.target).length || this.isInline || this.hide()
  194. }, this)
  195. }]
  196. ]
  197. },
  198. _attachEvents: function () {
  199. this._detachEvents(), this._applyEvents(this._events)
  200. },
  201. _detachEvents: function () {
  202. this._unapplyEvents(this._events)
  203. },
  204. _attachSecondaryEvents: function () {
  205. this._detachSecondaryEvents(), this._applyEvents(this._secondaryEvents)
  206. },
  207. _detachSecondaryEvents: function () {
  208. this._unapplyEvents(this._secondaryEvents)
  209. },
  210. _trigger: function (b, c) {
  211. var d = c || this.dates.get(-1),
  212. e = this._utc_to_local(d);
  213. this.element.trigger({
  214. type: b,
  215. date: e,
  216. dates: a.map(this.dates, this._utc_to_local),
  217. format: a.proxy(function (a, b) {
  218. 0 === arguments.length ? (a = this.dates.length - 1, b = this.o.format) : "string" == typeof a && (b = a, a = this.dates.length - 1), b = b || this.o.format;
  219. var c = this.dates.get(a);
  220. return r.formatDate(c, b, this.o.language)
  221. }, this)
  222. })
  223. },
  224. show: function () {
  225. return this.inputField.prop("disabled") || this.inputField.prop("readonly") && this.o.enableOnReadonly === !1 ? void 0 : (this.isInline || this.picker.appendTo(this.o.container), this.place(), this.picker.show(), this._attachSecondaryEvents(), this._trigger("show"), (window.navigator.msMaxTouchPoints || "ontouchstart" in document) && this.o.disableTouchKeyboard && a(this.element).blur(), this)
  226. },
  227. hide: function () {
  228. return this.isInline || !this.picker.is(":visible") ? this : (this.focusDate = null, this.picker.hide().detach(), this._detachSecondaryEvents(), this.setViewMode(this.o.startView), this.o.forceParse && this.inputField.val() && this.setValue(), this._trigger("hide"), this)
  229. },
  230. destroy: function () {
  231. return this.hide(), this._detachEvents(), this._detachSecondaryEvents(), this.picker.remove(), delete this.element.data().datepicker, this.isInput || delete this.element.data().date, this
  232. },
  233. paste: function (b) {
  234. var c;
  235. if (b.originalEvent.clipboardData && b.originalEvent.clipboardData.types && -1 !== a.inArray("text/plain", b.originalEvent.clipboardData.types)) c = b.originalEvent.clipboardData.getData("text/plain");
  236. else {
  237. if (!window.clipboardData) return;
  238. c = window.clipboardData.getData("Text")
  239. }
  240. this.setDate(c), this.update(), b.preventDefault()
  241. },
  242. _utc_to_local: function (a) {
  243. return a && new Date(a.getTime() + 6e4 * a.getTimezoneOffset())
  244. },
  245. _local_to_utc: function (a) {
  246. return a && new Date(a.getTime() - 6e4 * a.getTimezoneOffset())
  247. },
  248. _zero_time: function (a) {
  249. return a && new Date(a.getFullYear(), a.getMonth(), a.getDate())
  250. },
  251. _zero_utc_time: function (a) {
  252. return a && c(a.getUTCFullYear(), a.getUTCMonth(), a.getUTCDate())
  253. },
  254. getDates: function () {
  255. return a.map(this.dates, this._utc_to_local)
  256. },
  257. getUTCDates: function () {
  258. return a.map(this.dates, function (a) {
  259. return new Date(a)
  260. })
  261. },
  262. getDate: function () {
  263. return this._utc_to_local(this.getUTCDate())
  264. },
  265. getUTCDate: function () {
  266. var a = this.dates.get(-1);
  267. return a !== b ? new Date(a) : null
  268. },
  269. clearDates: function () {
  270. this.inputField.val(""), this.update(), this._trigger("changeDate"), this.o.autoclose && this.hide()
  271. },
  272. setDates: function () {
  273. var b = a.isArray(arguments[0]) ? arguments[0] : arguments;
  274. return this.update.apply(this, b), this._trigger("changeDate"), this.setValue(), this
  275. },
  276. setUTCDates: function () {
  277. var b = a.isArray(arguments[0]) ? arguments[0] : arguments;
  278. return this.setDates.apply(this, a.map(b, this._utc_to_local)), this
  279. },
  280. setDate: f("setDates"),
  281. setUTCDate: f("setUTCDates"),
  282. remove: f("destroy"),
  283. setValue: function () {
  284. var a = this.getFormattedDate();
  285. return this.inputField.val(a), this
  286. },
  287. getFormattedDate: function (c) {
  288. c === b && (c = this.o.format);
  289. var d = this.o.language;
  290. return a.map(this.dates, function (a) {
  291. return r.formatDate(a, c, d)
  292. }).join(this.o.multidateSeparator)
  293. },
  294. getStartDate: function () {
  295. return this.o.startDate
  296. },
  297. setStartDate: function (a) {
  298. return this._process_options({
  299. startDate: a
  300. }), this.update(), this.updateNavArrows(), this
  301. },
  302. getEndDate: function () {
  303. return this.o.endDate
  304. },
  305. setEndDate: function (a) {
  306. return this._process_options({
  307. endDate: a
  308. }), this.update(), this.updateNavArrows(), this
  309. },
  310. setDaysOfWeekDisabled: function (a) {
  311. return this._process_options({
  312. daysOfWeekDisabled: a
  313. }), this.update(), this
  314. },
  315. setDaysOfWeekHighlighted: function (a) {
  316. return this._process_options({
  317. daysOfWeekHighlighted: a
  318. }), this.update(), this
  319. },
  320. setDatesDisabled: function (a) {
  321. return this._process_options({
  322. datesDisabled: a
  323. }), this.update(), this
  324. },
  325. place: function () {
  326. if (this.isInline) return this;
  327. var b = this.picker.outerWidth(),
  328. c = this.picker.outerHeight(),
  329. d = 10,
  330. e = a(this.o.container),
  331. f = e.width(),
  332. g = "body" === this.o.container ? a(document).scrollTop() : e.scrollTop(),
  333. h = e.offset(),
  334. i = [];
  335. this.element.parents().each(function () {
  336. var b = a(this).css("z-index");
  337. "auto" !== b && 0 !== b && i.push(parseInt(b))
  338. });
  339. var j = Math.max.apply(Math, i) + this.o.zIndexOffset,
  340. k = this.component ? this.component.parent().offset() : this.element.offset(),
  341. l = this.component ? this.component.outerHeight(!0) : this.element.outerHeight(!1),
  342. m = this.component ? this.component.outerWidth(!0) : this.element.outerWidth(!1),
  343. n = k.left - h.left,
  344. o = k.top - h.top;
  345. "body" !== this.o.container && (o += g), this.picker.removeClass("datepicker-orient-top datepicker-orient-bottom datepicker-orient-right datepicker-orient-left"), "auto" !== this.o.orientation.x ? (this.picker.addClass("datepicker-orient-" + this.o.orientation.x), "right" === this.o.orientation.x && (n -= b - m)) : k.left < 0 ? (this.picker.addClass("datepicker-orient-left"), n -= k.left - d) : n + b > f ? (this.picker.addClass("datepicker-orient-right"), n += m - b) : this.picker.addClass("datepicker-orient-left");
  346. var p, q = this.o.orientation.y;
  347. if ("auto" === q && (p = -g + o - c, q = 0 > p ? "bottom" : "top"), this.picker.addClass("datepicker-orient-" + q), "top" === q ? o -= c + parseInt(this.picker.css("padding-top")) : o += l, this.o.rtl) {
  348. var r = f - (n + m);
  349. this.picker.css({
  350. top: o,
  351. right: r,
  352. zIndex: j
  353. })
  354. } else this.picker.css({
  355. top: o,
  356. left: n,
  357. zIndex: j
  358. });
  359. return this
  360. },
  361. _allow_update: !0,
  362. update: function () {
  363. if (!this._allow_update) return this;
  364. var b = this.dates.copy(),
  365. c = [],
  366. d = !1;
  367. return arguments.length ? (a.each(arguments, a.proxy(function (a, b) {
  368. b instanceof Date && (b = this._local_to_utc(b)), c.push(b)
  369. }, this)), d = !0) : (c = this.isInput ? this.element.val() : this.element.data("date") || this.inputField.val(), c = c && this.o.multidate ? c.split(this.o.multidateSeparator) : [c], delete this.element.data().date), c = a.map(c, a.proxy(function (a) {
  370. return r.parseDate(a, this.o.format, this.o.language, this.o.assumeNearbyYear)
  371. }, this)), c = a.grep(c, a.proxy(function (a) {
  372. return !this.dateWithinRange(a) || !a
  373. }, this), !0), this.dates.replace(c), this.dates.length ? this.viewDate = new Date(this.dates.get(-1)) : this.viewDate < this.o.startDate ? this.viewDate = new Date(this.o.startDate) : this.viewDate > this.o.endDate ? this.viewDate = new Date(this.o.endDate) : this.viewDate = this.o.defaultViewDate, d ? (this.setValue(), this.element.change()) : this.dates.length && String(b) !== String(this.dates) && d && (this._trigger("changeDate"), this.element.change()), !this.dates.length && b.length && (this._trigger("clearDate"), this.element.change()), this.fill(), this
  374. },
  375. fillDow: function () {
  376. var b = this.o.weekStart,
  377. c = "<tr>";
  378. for (this.o.calendarWeeks && (c += '<th class="cw">&#160;</th>'); b < this.o.weekStart + 7;) c += '<th class="dow', -1 !== a.inArray(b, this.o.daysOfWeekDisabled) && (c += " disabled"), c += '">' + q[this.o.language].daysMin[b++ % 7] + "</th>";
  379. c += "</tr>", this.picker.find(".datepicker-days thead").append(c)
  380. },
  381. fillMonths: function () {
  382. for (var a = this._utc_to_local(this.viewDate), b = "", c = 0; 12 > c;) {
  383. var d = a && a.getMonth() === c ? " focused" : "";
  384. b += '<span class="month' + d + '">' + q[this.o.language].monthsShort[c++] + "</span>"
  385. }
  386. this.picker.find(".datepicker-months td").html(b)
  387. },
  388. setRange: function (b) {
  389. b && b.length ? this.range = a.map(b, function (a) {
  390. return a.valueOf()
  391. }) : delete this.range, this.fill()
  392. },
  393. getClassNames: function (b) {
  394. var c = [],
  395. f = this.viewDate.getUTCFullYear(),
  396. g = this.viewDate.getUTCMonth(),
  397. h = d();
  398. return b.getUTCFullYear() < f || b.getUTCFullYear() === f && b.getUTCMonth() < g ? c.push("old") : (b.getUTCFullYear() > f || b.getUTCFullYear() === f && b.getUTCMonth() > g) && c.push("new"), this.focusDate && b.valueOf() === this.focusDate.valueOf() && c.push("focused"), this.o.todayHighlight && e(b, h) && c.push("today"), -1 !== this.dates.contains(b) && c.push("active"), this.dateWithinRange(b) || c.push("disabled"), this.dateIsDisabled(b) && c.push("disabled", "disabled-date"), -1 !== a.inArray(b.getUTCDay(), this.o.daysOfWeekHighlighted) && c.push("highlighted"), this.range && (b > this.range[0] && b < this.range[this.range.length - 1] && c.push("range"), -1 !== a.inArray(b.valueOf(), this.range) && c.push("selected"), b.valueOf() === this.range[0] && c.push("range-start"), b.valueOf() === this.range[this.range.length - 1] && c.push("range-end")), c
  399. },
  400. _fill_yearsView: function (c, d, e, f, g, h, i, j) {
  401. var k, l, m, n, o, p, q, r, s, t, u;
  402. for (k = "", l = this.picker.find(c), m = parseInt(g / e, 10) * e, o = parseInt(h / f, 10) * f, p = parseInt(i / f, 10) * f, n = a.map(this.dates, function (a) {
  403. return parseInt(a.getUTCFullYear() / f, 10) * f
  404. }), l.find(".datepicker-switch").text(m + "-" + (m + 9 * f)), q = m - f, r = -1; 11 > r; r += 1) s = [d], t = null, -1 === r ? s.push("old") : 10 === r && s.push("new"), -1 !== a.inArray(q, n) && s.push("active"), (o > q || q > p) && s.push("disabled"), q === this.viewDate.getFullYear() && s.push("focused"), j !== a.noop && (u = j(new Date(q, 0, 1)), u === b ? u = {} : "boolean" == typeof u ? u = {
  405. enabled: u
  406. } : "string" == typeof u && (u = {
  407. classes: u
  408. }), u.enabled === !1 && s.push("disabled"), u.classes && (s = s.concat(u.classes.split(/\s+/))), u.tooltip && (t = u.tooltip)), k += '<span class="' + s.join(" ") + '"' + (t ? ' title="' + t + '"' : "") + ">" + q + "</span>", q += f;
  409. l.find("td").html(k)
  410. },
  411. fill: function () {
  412. var d, e, f = new Date(this.viewDate),
  413. g = f.getUTCFullYear(),
  414. h = f.getUTCMonth(),
  415. i = this.o.startDate !== -(1 / 0) ? this.o.startDate.getUTCFullYear() : -(1 / 0),
  416. j = this.o.startDate !== -(1 / 0) ? this.o.startDate.getUTCMonth() : -(1 / 0),
  417. k = this.o.endDate !== 1 / 0 ? this.o.endDate.getUTCFullYear() : 1 / 0,
  418. l = this.o.endDate !== 1 / 0 ? this.o.endDate.getUTCMonth() : 1 / 0,
  419. m = q[this.o.language].today || q.en.today || "",
  420. n = q[this.o.language].clear || q.en.clear || "",
  421. o = q[this.o.language].titleFormat || q.en.titleFormat;
  422. if (!isNaN(g) && !isNaN(h)) {
  423. this.picker.find(".datepicker-days .datepicker-switch").text(r.formatDate(f, o, this.o.language)), this.picker.find("tfoot .today").text(m).toggle(this.o.todayBtn !== !1), this.picker.find("tfoot .clear").text(n).toggle(this.o.clearBtn !== !1), this.picker.find("thead .datepicker-title").text(this.o.title).toggle("" !== this.o.title), this.updateNavArrows(), this.fillMonths();
  424. var p = c(g, h, 0),
  425. s = p.getUTCDate();
  426. p.setUTCDate(s - (p.getUTCDay() - this.o.weekStart + 7) % 7);
  427. var t = new Date(p);
  428. p.getUTCFullYear() < 100 && t.setUTCFullYear(p.getUTCFullYear()), t.setUTCDate(t.getUTCDate() + 42), t = t.valueOf();
  429. for (var u, v, w = []; p.valueOf() < t;) {
  430. if (u = p.getUTCDay(), u === this.o.weekStart && (w.push("<tr>"), this.o.calendarWeeks)) {
  431. var x = new Date(+p + (this.o.weekStart - u - 7) % 7 * 864e5),
  432. y = new Date(Number(x) + (11 - x.getUTCDay()) % 7 * 864e5),
  433. z = new Date(Number(z = c(y.getUTCFullYear(), 0, 1)) + (11 - z.getUTCDay()) % 7 * 864e5),
  434. A = (y - z) / 864e5 / 7 + 1;
  435. w.push('<td class="cw">' + A + "</td>")
  436. }
  437. v = this.getClassNames(p), v.push("day"), this.o.beforeShowDay !== a.noop && (e = this.o.beforeShowDay(this._utc_to_local(p)), e === b ? e = {} : "boolean" == typeof e ? e = {
  438. enabled: e
  439. } : "string" == typeof e && (e = {
  440. classes: e
  441. }), e.enabled === !1 && v.push("disabled"), e.classes && (v = v.concat(e.classes.split(/\s+/))), e.tooltip && (d = e.tooltip)), v = a.unique(v), w.push('<td class="' + v.join(" ") + '"' + (d ? ' title="' + d + '"' : "") + (this.o.dateCells ? ' data-date="' + p.getTime().toString() + '"' : "") + ">" + p.getUTCDate() + "</td>"), d = null, u === this.o.weekEnd && w.push("</tr>"), p.setUTCDate(p.getUTCDate() + 1)
  442. }
  443. this.picker.find(".datepicker-days tbody").html(w.join(""));
  444. var B = q[this.o.language].monthsTitle || q.en.monthsTitle || "Months",
  445. C = this.picker.find(".datepicker-months").find(".datepicker-switch").text(this.o.maxViewMode < 2 ? B : g).end().find("tbody span").removeClass("active");
  446. if (a.each(this.dates, function (a, b) {
  447. b.getUTCFullYear() === g && C.eq(b.getUTCMonth()).addClass("active")
  448. }), (i > g || g > k) && C.addClass("disabled"), g === i && C.slice(0, j).addClass("disabled"), g === k && C.slice(l + 1).addClass("disabled"), this.o.beforeShowMonth !== a.noop) {
  449. var D = this;
  450. a.each(C, function (c, d) {
  451. var e = new Date(g, c, 1),
  452. f = D.o.beforeShowMonth(e);
  453. f === b ? f = {} : "boolean" == typeof f ? f = {
  454. enabled: f
  455. } : "string" == typeof f && (f = {
  456. classes: f
  457. }), f.enabled !== !1 || a(d).hasClass("disabled") || a(d).addClass("disabled"), f.classes && a(d).addClass(f.classes), f.tooltip && a(d).prop("title", f.tooltip)
  458. })
  459. }
  460. this._fill_yearsView(".datepicker-years", "year", 10, 1, g, i, k, this.o.beforeShowYear), this._fill_yearsView(".datepicker-decades", "decade", 100, 10, g, i, k, this.o.beforeShowDecade), this._fill_yearsView(".datepicker-centuries", "century", 1e3, 100, g, i, k, this.o.beforeShowCentury)
  461. }
  462. },
  463. updateNavArrows: function () {
  464. if (this._allow_update) {
  465. var a, b, c = new Date(this.viewDate),
  466. d = c.getUTCFullYear(),
  467. e = c.getUTCMonth();
  468. switch (this.viewMode) {
  469. case 0:
  470. a = this.o.startDate !== -(1 / 0) && d <= this.o.startDate.getUTCFullYear() && e <= this.o.startDate.getUTCMonth(), b = this.o.endDate !== 1 / 0 && d >= this.o.endDate.getUTCFullYear() && e >= this.o.endDate.getUTCMonth();
  471. break;
  472. case 1:
  473. case 2:
  474. case 3:
  475. case 4:
  476. a = this.o.startDate !== -(1 / 0) && d <= this.o.startDate.getUTCFullYear(), b = this.o.endDate !== 1 / 0 && d >= this.o.endDate.getUTCFullYear()
  477. }
  478. this.picker.find(".prev").toggleClass("disabled", a), this.picker.find(".next").toggleClass("disabled", b)
  479. }
  480. },
  481. click: function (b) {
  482. b.preventDefault(), b.stopPropagation();
  483. var e, f, g, h, i;
  484. e = a(b.target), e.hasClass("datepicker-switch") && this.setViewMode(this.viewMode + 1), e.hasClass("today") && !e.hasClass("day") && (this.setViewMode(0), this._setDate(d(), "linked" === this.o.todayBtn ? null : "view")), e.hasClass("clear") && this.clearDates(), e.hasClass("disabled") || (e.hasClass("day") && (g = Number(e.text()), h = this.viewDate.getUTCFullYear(), i = this.viewDate.getUTCMonth(), (e.hasClass("old") || e.hasClass("new")) && (f = e.hasClass("old") ? -1 : 1, i = (i + f + 12) % 12, (-1 === f && 11 === i || 1 === f && 0 === i) && (h += f, this._trigger("changeYear", this.viewDate)), this._trigger("changeMonth", this.viewDate)), this._setDate(c(h, i, g))), (e.hasClass("month") || e.hasClass("year") || e.hasClass("decade") || e.hasClass("century")) && (this.viewDate.setUTCDate(1), g = 1, 1 === this.viewMode ? (i = e.parent().find("span").index(e), h = this.viewDate.getUTCFullYear(), this.viewDate.setUTCMonth(i)) : (i = 0, h = Number(e.text()), this.viewDate.setUTCFullYear(h)), this._trigger(r.viewModes[this.viewMode - 1].e, this.viewDate), this.viewMode === this.o.minViewMode ? this._setDate(c(h, i, g)) : (this.setViewMode(this.viewMode - 1), this.fill()))), this.picker.is(":visible") && this._focused_from && this._focused_from.focus(), delete this._focused_from
  485. },
  486. navArrowsClick: function (b) {
  487. var c = a(b.target),
  488. d = c.hasClass("prev") ? -1 : 1;
  489. 0 !== this.viewMode && (d *= 12 * r.viewModes[this.viewMode].navStep), this.viewDate = this.moveMonth(this.viewDate, d), this._trigger(r.viewModes[this.viewMode].e, this.viewDate), this.fill()
  490. },
  491. _toggle_multidate: function (a) {
  492. var b = this.dates.contains(a);
  493. if (a || this.dates.clear(), -1 !== b ? (this.o.multidate === !0 || this.o.multidate > 1 || this.o.toggleActive) && this.dates.remove(b) : this.o.multidate === !1 ? (this.dates.clear(), this.dates.push(a)) : this.dates.push(a), "number" == typeof this.o.multidate)
  494. for (; this.dates.length > this.o.multidate;) this.dates.remove(0)
  495. },
  496. _setDate: function (a, b) {
  497. b && "date" !== b || this._toggle_multidate(a && new Date(a)), b && "view" !== b || (this.viewDate = a && new Date(a)), this.fill(), this.setValue(), b && "view" === b || this._trigger("changeDate"), this.inputField.trigger("change"), !this.o.autoclose || b && "date" !== b || this.hide()
  498. },
  499. moveDay: function (a, b) {
  500. var c = new Date(a);
  501. return c.setUTCDate(a.getUTCDate() + b), c
  502. },
  503. moveWeek: function (a, b) {
  504. return this.moveDay(a, 7 * b)
  505. },
  506. moveMonth: function (a, b) {
  507. if (!g(a)) return this.o.defaultViewDate;
  508. if (!b) return a;
  509. var c, d, e = new Date(a.valueOf()),
  510. f = e.getUTCDate(),
  511. h = e.getUTCMonth(),
  512. i = Math.abs(b);
  513. if (b = b > 0 ? 1 : -1, 1 === i) d = -1 === b ? function () {
  514. return e.getUTCMonth() === h
  515. } : function () {
  516. return e.getUTCMonth() !== c
  517. }, c = h + b, e.setUTCMonth(c), c = (c + 12) % 12;
  518. else {
  519. for (var j = 0; i > j; j++) e = this.moveMonth(e, b);
  520. c = e.getUTCMonth(), e.setUTCDate(f), d = function () {
  521. return c !== e.getUTCMonth()
  522. }
  523. }
  524. for (; d();) e.setUTCDate(--f), e.setUTCMonth(c);
  525. return e
  526. },
  527. moveYear: function (a, b) {
  528. return this.moveMonth(a, 12 * b)
  529. },
  530. moveAvailableDate: function (a, b, c) {
  531. do {
  532. if (a = this[c](a, b), !this.dateWithinRange(a)) return !1;
  533. c = "moveDay"
  534. } while (this.dateIsDisabled(a));
  535. return a
  536. },
  537. weekOfDateIsDisabled: function (b) {
  538. return -1 !== a.inArray(b.getUTCDay(), this.o.daysOfWeekDisabled)
  539. },
  540. dateIsDisabled: function (b) {
  541. return this.weekOfDateIsDisabled(b) || a.grep(this.o.datesDisabled, function (a) {
  542. return e(b, a)
  543. }).length > 0
  544. },
  545. dateWithinRange: function (a) {
  546. return a >= this.o.startDate && a <= this.o.endDate
  547. },
  548. keydown: function (a) {
  549. if (!this.picker.is(":visible")) return void ((40 === a.keyCode || 27 === a.keyCode) && (this.show(), a.stopPropagation()));
  550. var b, c, d = !1,
  551. e = this.focusDate || this.viewDate;
  552. switch (a.keyCode) {
  553. case 27:
  554. this.focusDate ? (this.focusDate = null, this.viewDate = this.dates.get(-1) || this.viewDate, this.fill()) : this.hide(), a.preventDefault(), a.stopPropagation();
  555. break;
  556. case 37:
  557. case 38:
  558. case 39:
  559. case 40:
  560. if (!this.o.keyboardNavigation || 7 === this.o.daysOfWeekDisabled.length) break;
  561. b = 37 === a.keyCode || 38 === a.keyCode ? -1 : 1, 0 === this.viewMode ? a.ctrlKey ? (c = this.moveAvailableDate(e, b, "moveYear"), c && this._trigger("changeYear", this.viewDate)) : a.shiftKey ? (c = this.moveAvailableDate(e, b, "moveMonth"), c && this._trigger("changeMonth", this.viewDate)) : 37 === a.keyCode || 39 === a.keyCode ? c = this.moveAvailableDate(e, b, "moveDay") : this.weekOfDateIsDisabled(e) || (c = this.moveAvailableDate(e, b, "moveWeek")) : 1 === this.viewMode ? ((38 === a.keyCode || 40 === a.keyCode) && (b = 4 * b), c = this.moveAvailableDate(e, b, "moveMonth")) : 2 === this.viewMode && ((38 === a.keyCode || 40 === a.keyCode) && (b = 4 * b), c = this.moveAvailableDate(e, b, "moveYear")), c && (this.focusDate = this.viewDate = c, this.setValue(), this.fill(), a.preventDefault());
  562. break;
  563. case 13:
  564. if (!this.o.forceParse) break;
  565. e = this.focusDate || this.dates.get(-1) || this.viewDate, this.o.keyboardNavigation && (this._toggle_multidate(e), d = !0), this.focusDate = null, this.viewDate = this.dates.get(-1) || this.viewDate, this.setValue(), this.fill(), this.picker.is(":visible") && (a.preventDefault(), a.stopPropagation(), this.o.autoclose && this.hide());
  566. break;
  567. case 9:
  568. this.focusDate = null, this.viewDate = this.dates.get(-1) || this.viewDate, this.fill(), this.hide()
  569. }
  570. d && (this.dates.length ? this._trigger("changeDate") : this._trigger("clearDate"), this.inputField.trigger("change"))
  571. },
  572. setViewMode: function (a) {
  573. this.viewMode = a, this.picker.children("div").hide().filter(".datepicker-" + r.viewModes[this.viewMode].clsName).show(), this.updateNavArrows()
  574. }
  575. };
  576. var l = function (b, c) {
  577. a.data(b, "datepicker", this), this.element = a(b), this.inputs = a.map(c.inputs, function (a) {
  578. return a.jquery ? a[0] : a
  579. }), delete c.inputs, this.keepEmptyValues = c.keepEmptyValues, delete c.keepEmptyValues, n.call(a(this.inputs), c).on("changeDate", a.proxy(this.dateUpdated, this)), this.pickers = a.map(this.inputs, function (b) {
  580. return a.data(b, "datepicker")
  581. }), this.updateDates()
  582. };
  583. l.prototype = {
  584. updateDates: function () {
  585. this.dates = a.map(this.pickers, function (a) {
  586. return a.getUTCDate()
  587. }), this.updateRanges()
  588. },
  589. updateRanges: function () {
  590. var b = a.map(this.dates, function (a) {
  591. return a.valueOf()
  592. });
  593. a.each(this.pickers, function (a, c) {
  594. c.setRange(b)
  595. })
  596. },
  597. dateUpdated: function (c) {
  598. if (!this.updating) {
  599. this.updating = !0;
  600. var d = a.data(c.target, "datepicker");
  601. if (d !== b) {
  602. var e = d.getUTCDate(),
  603. f = this.keepEmptyValues,
  604. g = a.inArray(c.target, this.inputs),
  605. h = g - 1,
  606. i = g + 1,
  607. j = this.inputs.length;
  608. if (-1 !== g) {
  609. if (a.each(this.pickers, function (a, b) {
  610. b.getUTCDate() || b !== d && f || b.setUTCDate(e)
  611. }), e < this.dates[h])
  612. for (; h >= 0 && e < this.dates[h];) this.pickers[h--].setUTCDate(e);
  613. else if (e > this.dates[i])
  614. for (; j > i && e > this.dates[i];) this.pickers[i++].setUTCDate(e);
  615. this.updateDates(), delete this.updating
  616. }
  617. }
  618. }
  619. },
  620. destroy: function () {
  621. a.map(this.pickers, function (a) {
  622. a.destroy()
  623. }), delete this.element.data().datepicker
  624. },
  625. remove: f("destroy")
  626. };
  627. var m = a.fn.datepicker,
  628. n = function (c) {
  629. var d = Array.apply(null, arguments);
  630. d.shift();
  631. var e;
  632. if (this.each(function () {
  633. var b = a(this),
  634. f = b.data("datepicker"),
  635. g = "object" == typeof c && c;
  636. if (!f) {
  637. var j = h(this, "date"),
  638. m = a.extend({}, o, j, g),
  639. n = i(m.language),
  640. p = a.extend({}, o, n, j, g);
  641. b.hasClass("input-daterange") || p.inputs ? (a.extend(p, {
  642. inputs: p.inputs || b.find("input").toArray()
  643. }), f = new l(this, p)) : f = new k(this, p), b.data("datepicker", f)
  644. }
  645. "string" == typeof c && "function" == typeof f[c] && (e = f[c].apply(f, d))
  646. }), e === b || e instanceof k || e instanceof l) return this;
  647. if (this.length > 1) throw new Error("Using only allowed for the collection of a single element (" + c + " function)");
  648. return e
  649. };
  650. a.fn.datepicker = n;
  651. var o = a.fn.datepicker.defaults = {
  652. assumeNearbyYear: !1,
  653. autoclose: !1,
  654. beforeShowDay: a.noop,
  655. beforeShowMonth: a.noop,
  656. beforeShowYear: a.noop,
  657. beforeShowDecade: a.noop,
  658. beforeShowCentury: a.noop,
  659. calendarWeeks: !1,
  660. clearBtn: !1,
  661. toggleActive: !1,
  662. daysOfWeekDisabled: [],
  663. daysOfWeekHighlighted: [],
  664. datesDisabled: [],
  665. endDate: 1 / 0,
  666. forceParse: !0,
  667. format: "mm/dd/yyyy",
  668. keepEmptyValues: !1,
  669. keyboardNavigation: !0,
  670. language: "en",
  671. minViewMode: 0,
  672. maxViewMode: 4,
  673. multidate: !1,
  674. multidateSeparator: ",",
  675. orientation: "auto",
  676. rtl: !1,
  677. startDate: -(1 / 0),
  678. startView: 0,
  679. todayBtn: !1,
  680. todayHighlight: !1,
  681. weekStart: 0,
  682. disableTouchKeyboard: !1,
  683. enableOnReadonly: !0,
  684. showOnFocus: !0,
  685. zIndexOffset: 10,
  686. container: "body",
  687. immediateUpdates: !1,
  688. dateCells: !1,
  689. title: "",
  690. templates: {
  691. leftArrow: "&laquo;",
  692. rightArrow: "&raquo;"
  693. }
  694. },
  695. p = a.fn.datepicker.locale_opts = ["format", "rtl", "weekStart"];
  696. a.fn.datepicker.Constructor = k;
  697. var q = a.fn.datepicker.dates = {
  698. en: {
  699. days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
  700. daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
  701. daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
  702. months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
  703. monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
  704. today: "Today",
  705. clear: "Clear",
  706. titleFormat: "MM yyyy"
  707. }
  708. },
  709. r = {
  710. viewModes: [{
  711. names: ["days", "month"],
  712. clsName: "days",
  713. e: "changeMonth"
  714. }, {
  715. names: ["months", "year"],
  716. clsName: "months",
  717. e: "changeYear",
  718. navStep: 1
  719. }, {
  720. names: ["years", "decade"],
  721. clsName: "years",
  722. e: "changeDecade",
  723. navStep: 10
  724. }, {
  725. names: ["decades", "century"],
  726. clsName: "decades",
  727. e: "changeCentury",
  728. navStep: 100
  729. }, {
  730. names: ["centuries", "millennium"],
  731. clsName: "centuries",
  732. e: "changeMillennium",
  733. navStep: 1e3
  734. }],
  735. validParts: /dd?|DD?|mm?|MM?|yy(?:yy)?/g,
  736. nonpunctuation: /[^ -\/:-@\u5e74\u6708\u65e5\[-`{-~\t\n\r]+/g,
  737. parseFormat: function (a) {
  738. if ("function" == typeof a.toValue && "function" == typeof a.toDisplay) return a;
  739. var b = a.replace(this.validParts, "\x00").split("\x00"),
  740. c = a.match(this.validParts);
  741. if (!b || !b.length || !c || 0 === c.length) throw new Error("Invalid date format.");
  742. return {
  743. separators: b,
  744. parts: c
  745. }
  746. },
  747. parseDate: function (e, f, g, h) {
  748. function i(a, b) {
  749. return b === !0 && (b = 10), 100 > a && (a += 2e3, a > (new Date).getFullYear() + b && (a -= 100)), a
  750. }
  751. function j() {
  752. var a = this.slice(0, s[n].length),
  753. b = s[n].slice(0, a.length);
  754. return a.toLowerCase() === b.toLowerCase()
  755. }
  756. if (!e) return b;
  757. if (e instanceof Date) return e;
  758. if ("string" == typeof f && (f = r.parseFormat(f)), f.toValue) return f.toValue(e, f, g);
  759. var l, m, n, o, p = /([\-+]\d+)([dmwy])/,
  760. s = e.match(/([\-+]\d+)([dmwy])/g),
  761. t = {
  762. d: "moveDay",
  763. m: "moveMonth",
  764. w: "moveWeek",
  765. y: "moveYear"
  766. },
  767. u = {
  768. yesterday: "-1d",
  769. today: "+0d",
  770. tomorrow: "+1d"
  771. };
  772. if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(e)) {
  773. for (e = new Date, n = 0; n < s.length; n++) l = p.exec(s[n]), m = parseInt(l[1]), o = t[l[2]], e = k.prototype[o](e, m);
  774. return c(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
  775. }
  776. if (e in u && (e = u[e], s = e.match(/([\-+]\d+)([dmwy])/g), /^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(e))) {
  777. for (e = new Date, n = 0; n < s.length; n++) l = p.exec(s[n]), m = parseInt(l[1]), o = t[l[2]], e = k.prototype[o](e, m);
  778. return c(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
  779. }
  780. s = e && e.match(this.nonpunctuation) || [], e = new Date;
  781. var v, w, x = {},
  782. y = ["yyyy", "yy", "M", "MM", "m", "mm", "d", "dd"],
  783. z = {
  784. yyyy: function (a, b) {
  785. return a.setUTCFullYear(h ? i(b, h) : b)
  786. },
  787. m: function (a, b) {
  788. if (isNaN(a)) return a;
  789. for (b -= 1; 0 > b;) b += 12;
  790. for (b %= 12, a.setUTCMonth(b); a.getUTCMonth() !== b;) a.setUTCDate(a.getUTCDate() - 1);
  791. return a
  792. },
  793. d: function (a, b) {
  794. return a.setUTCDate(b)
  795. }
  796. };
  797. z.yy = z.yyyy, z.M = z.MM = z.mm = z.m, z.dd = z.d, e = d();
  798. var A = f.parts.slice();
  799. if (s.length !== A.length && (A = a(A).filter(function (b, c) {
  800. return -1 !== a.inArray(c, y)
  801. }).toArray()), s.length === A.length) {
  802. var B;
  803. for (n = 0, B = A.length; B > n; n++) {
  804. if (v = parseInt(s[n], 10), l = A[n], isNaN(v)) switch (l) {
  805. case "MM":
  806. w = a(q[g].months).filter(j), v = a.inArray(w[0], q[g].months) + 1;
  807. break;
  808. case "M":
  809. w = a(q[g].monthsShort).filter(j), v = a.inArray(w[0], q[g].monthsShort) + 1
  810. }
  811. x[l] = v
  812. }
  813. var C, D;
  814. for (n = 0; n < y.length; n++) D = y[n], D in x && !isNaN(x[D]) && (C = new Date(e), z[D](C, x[D]), isNaN(C) || (e = C))
  815. }
  816. return e
  817. },
  818. formatDate: function (b, c, d) {
  819. if (!b) return "";
  820. if ("string" == typeof c && (c = r.parseFormat(c)), c.toDisplay) return c.toDisplay(b, c, d);
  821. var e = {
  822. d: b.getUTCDate(),
  823. D: q[d].daysShort[b.getUTCDay()],
  824. DD: q[d].days[b.getUTCDay()],
  825. m: b.getUTCMonth() + 1,
  826. M: q[d].monthsShort[b.getUTCMonth()],
  827. MM: q[d].months[b.getUTCMonth()],
  828. yy: b.getUTCFullYear().toString().substring(2),
  829. yyyy: b.getUTCFullYear()
  830. };
  831. e.dd = (e.d < 10 ? "0" : "") + e.d, e.mm = (e.m < 10 ? "0" : "") + e.m, b = [];
  832. for (var f = a.extend([], c.separators), g = 0, h = c.parts.length; h >= g; g++) f.length && b.push(f.shift()), b.push(e[c.parts[g]]);
  833. return b.join("")
  834. },
  835. headTemplate: '<thead><tr><th colspan="7" class="datepicker-title"></th></tr><tr><th class="prev">&laquo;</th><th colspan="5" class="datepicker-switch"></th><th class="next">&raquo;</th></tr></thead>',
  836. contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>',
  837. footTemplate: '<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>'
  838. };
  839. r.template = '<div class="datepicker"><div class="datepicker-days"><table class="table-condensed">' + r.headTemplate + "<tbody></tbody>" + r.footTemplate + '</table></div><div class="datepicker-months"><table class="table-condensed">' + r.headTemplate + r.contTemplate + r.footTemplate + '</table></div><div class="datepicker-years"><table class="table-condensed">' + r.headTemplate + r.contTemplate + r.footTemplate + '</table></div><div class="datepicker-decades"><table class="table-condensed">' + r.headTemplate + r.contTemplate + r.footTemplate + '</table></div><div class="datepicker-centuries"><table class="table-condensed">' + r.headTemplate + r.contTemplate + r.footTemplate + "</table></div></div>",
  840. a.fn.datepicker.DPGlobal = r, a.fn.datepicker.noConflict = function () {
  841. return a.fn.datepicker = m, this
  842. }, a.fn.datepicker.version = "1.7.0-dev", a(document).on("focus.datepicker.data-api click.datepicker.data-api", '[data-provide="datepicker"]', function (b) {
  843. var c = a(this);
  844. c.data("datepicker") || (b.preventDefault(), n.call(c, "show"))
  845. }), a(function () {
  846. n.call(a('[data-provide="datepicker-inline"]'))
  847. })
  848. });