bootstrap-datetimepicker.min.js 56 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961
  1. ! function (e) {
  2. "use strict";
  3. if ("function" == typeof define && define.amd) define(["jquery", "moment"], e);
  4. else if ("object" == typeof exports) module.exports = e(require("jquery"), require("moment"));
  5. else {
  6. if ("undefined" == typeof jQuery) throw "bootstrap-datetimepicker requires jQuery to be loaded first";
  7. if ("undefined" == typeof moment) throw "bootstrap-datetimepicker requires Moment.js to be loaded first";
  8. e(jQuery, moment)
  9. }
  10. }(function (e, t) {
  11. "use strict";
  12. if (!t) throw new Error("bootstrap-datetimepicker requires Moment.js to be loaded first");
  13. var a = function (a, n) {
  14. var r, i, o, s, d, l, p, c = {},
  15. u = !0,
  16. f = !1,
  17. m = !1,
  18. h = 0,
  19. y = [{
  20. clsName: "days",
  21. navFnc: "M",
  22. navStep: 1
  23. }, {
  24. clsName: "months",
  25. navFnc: "y",
  26. navStep: 1
  27. }, {
  28. clsName: "years",
  29. navFnc: "y",
  30. navStep: 10
  31. }, {
  32. clsName: "decades",
  33. navFnc: "y",
  34. navStep: 100
  35. }],
  36. w = ["days", "months", "years", "decades"],
  37. b = ["top", "bottom", "auto"],
  38. g = ["left", "right", "auto"],
  39. v = ["default", "top", "bottom"],
  40. k = {
  41. up: 38,
  42. 38: "up",
  43. down: 40,
  44. 40: "down",
  45. left: 37,
  46. 37: "left",
  47. right: 39,
  48. 39: "right",
  49. tab: 9,
  50. 9: "tab",
  51. escape: 27,
  52. 27: "escape",
  53. enter: 13,
  54. 13: "enter",
  55. pageUp: 33,
  56. 33: "pageUp",
  57. pageDown: 34,
  58. 34: "pageDown",
  59. shift: 16,
  60. 16: "shift",
  61. control: 17,
  62. 17: "control",
  63. space: 32,
  64. 32: "space",
  65. t: 84,
  66. 84: "t",
  67. delete: 46,
  68. 46: "delete"
  69. },
  70. D = {},
  71. C = function () {
  72. return void 0 !== t.tz && void 0 !== n.timeZone && null !== n.timeZone && "" !== n.timeZone
  73. },
  74. x = function (e) {
  75. var a;
  76. return a = void 0 === e || null === e ? t() : t.isDate(e) || t.isMoment(e) ? t(e) : C() ? t.tz(e, l, n.useStrict, n.timeZone) : t(e, l, n.useStrict), C() && a.tz(n.timeZone), a
  77. },
  78. T = function (e) {
  79. if ("string" != typeof e || e.length > 1) throw new TypeError("isEnabled expects a single character string parameter");
  80. switch (e) {
  81. case "y":
  82. return -1 !== d.indexOf("Y");
  83. case "M":
  84. return -1 !== d.indexOf("M");
  85. case "d":
  86. return -1 !== d.toLowerCase().indexOf("d");
  87. case "h":
  88. case "H":
  89. return -1 !== d.toLowerCase().indexOf("h");
  90. case "m":
  91. return -1 !== d.indexOf("m");
  92. case "s":
  93. return -1 !== d.indexOf("s");
  94. default:
  95. return !1
  96. }
  97. },
  98. M = function () {
  99. return T("h") || T("m") || T("s")
  100. },
  101. S = function () {
  102. return T("y") || T("M") || T("d")
  103. },
  104. O = function () {
  105. var t = e("<thead>").append(e("<tr>").append(e("<th>").addClass("prev").attr("data-action", "previous").append(e("<i>").addClass(n.icons.previous))).append(e("<th>").addClass("picker-switch").attr("data-action", "pickerSwitch").attr("colspan", n.calendarWeeks ? "6" : "5")).append(e("<th>").addClass("next").attr("data-action", "next").append(e("<i>").addClass(n.icons.next)))),
  106. a = e("<tbody>").append(e("<tr>").append(e("<td>").attr("colspan", n.calendarWeeks ? "8" : "7")));
  107. return [e("<div>").addClass("datepicker-days").append(e("<table>").addClass("table-condensed").append(t).append(e("<tbody>"))), e("<div>").addClass("datepicker-months").append(e("<table>").addClass("table-condensed").append(t.clone()).append(a.clone())), e("<div>").addClass("datepicker-years").append(e("<table>").addClass("table-condensed").append(t.clone()).append(a.clone())), e("<div>").addClass("datepicker-decades").append(e("<table>").addClass("table-condensed").append(t.clone()).append(a.clone()))]
  108. },
  109. P = function () {
  110. var t = e("<tr>"),
  111. a = e("<tr>"),
  112. r = e("<tr>");
  113. return T("h") && (t.append(e("<td>").append(e("<a>").attr({
  114. href: "#",
  115. tabindex: "-1",
  116. title: n.tooltips.incrementHour
  117. }).addClass("btn").attr("data-action", "incrementHours").append(e("<i>").addClass(n.icons.up)))), a.append(e("<td>").append(e("<span>").addClass("timepicker-hour").attr({
  118. "data-time-component": "hours",
  119. title: n.tooltips.pickHour
  120. }).attr("data-action", "showHours"))), r.append(e("<td>").append(e("<a>").attr({
  121. href: "#",
  122. tabindex: "-1",
  123. title: n.tooltips.decrementHour
  124. }).addClass("btn").attr("data-action", "decrementHours").append(e("<i>").addClass(n.icons.down))))), T("m") && (T("h") && (t.append(e("<td>").addClass("separator")), a.append(e("<td>").addClass("separator").html(":")), r.append(e("<td>").addClass("separator"))), t.append(e("<td>").append(e("<a>").attr({
  125. href: "#",
  126. tabindex: "-1",
  127. title: n.tooltips.incrementMinute
  128. }).addClass("btn").attr("data-action", "incrementMinutes").append(e("<i>").addClass(n.icons.up)))), a.append(e("<td>").append(e("<span>").addClass("timepicker-minute").attr({
  129. "data-time-component": "minutes",
  130. title: n.tooltips.pickMinute
  131. }).attr("data-action", "showMinutes"))), r.append(e("<td>").append(e("<a>").attr({
  132. href: "#",
  133. tabindex: "-1",
  134. title: n.tooltips.decrementMinute
  135. }).addClass("btn").attr("data-action", "decrementMinutes").append(e("<i>").addClass(n.icons.down))))), T("s") && (T("m") && (t.append(e("<td>").addClass("separator")), a.append(e("<td>").addClass("separator").html(":")), r.append(e("<td>").addClass("separator"))), t.append(e("<td>").append(e("<a>").attr({
  136. href: "#",
  137. tabindex: "-1",
  138. title: n.tooltips.incrementSecond
  139. }).addClass("btn").attr("data-action", "incrementSeconds").append(e("<i>").addClass(n.icons.up)))), a.append(e("<td>").append(e("<span>").addClass("timepicker-second").attr({
  140. "data-time-component": "seconds",
  141. title: n.tooltips.pickSecond
  142. }).attr("data-action", "showSeconds"))), r.append(e("<td>").append(e("<a>").attr({
  143. href: "#",
  144. tabindex: "-1",
  145. title: n.tooltips.decrementSecond
  146. }).addClass("btn").attr("data-action", "decrementSeconds").append(e("<i>").addClass(n.icons.down))))), s || (t.append(e("<td>").addClass("separator")), a.append(e("<td>").append(e("<button>").addClass("btn btn-primary").attr({
  147. "data-action": "togglePeriod",
  148. tabindex: "-1",
  149. title: n.tooltips.togglePeriod
  150. }))), r.append(e("<td>").addClass("separator"))), e("<div>").addClass("timepicker-picker").append(e("<table>").addClass("table-condensed").append([t, a, r]))
  151. },
  152. E = function () {
  153. var t = e("<div>").addClass("timepicker-hours").append(e("<table>").addClass("table-condensed")),
  154. a = e("<div>").addClass("timepicker-minutes").append(e("<table>").addClass("table-condensed")),
  155. n = e("<div>").addClass("timepicker-seconds").append(e("<table>").addClass("table-condensed")),
  156. r = [P()];
  157. return T("h") && r.push(t), T("m") && r.push(a), T("s") && r.push(n), r
  158. },
  159. H = function () {
  160. var t = [];
  161. return n.showTodayButton && t.push(e("<td>").append(e("<a>").attr({
  162. "data-action": "today",
  163. title: n.tooltips.today
  164. }).append(e("<i>").addClass(n.icons.today)))), !n.sideBySide && S() && M() && t.push(e("<td>").append(e("<a>").attr({
  165. "data-action": "togglePicker",
  166. title: n.tooltips.selectTime
  167. }).append(e("<i>").addClass(n.icons.time)))), n.showClear && t.push(e("<td>").append(e("<a>").attr({
  168. "data-action": "clear",
  169. title: n.tooltips.clear
  170. }).append(e("<i>").addClass(n.icons.clear)))), n.showClose && t.push(e("<td>").append(e("<a>").attr({
  171. "data-action": "close",
  172. title: n.tooltips.close
  173. }).append(e("<i>").addClass(n.icons.close)))), e("<table>").addClass("table-condensed").append(e("<tbody>").append(e("<tr>").append(t)))
  174. },
  175. I = function () {
  176. var t = e("<div>").addClass("bootstrap-datetimepicker-widget dropdown-menu"),
  177. a = e("<div>").addClass("datepicker").append(O()),
  178. r = e("<div>").addClass("timepicker").append(E()),
  179. i = e("<ul>").addClass("list-unstyled"),
  180. o = e("<li>").addClass("picker-switch" + (n.collapse ? " accordion-toggle" : "")).append(H());
  181. return n.inline && t.removeClass("dropdown-menu"), s && t.addClass("usetwentyfour"), T("s") && !s && t.addClass("wider"), n.sideBySide && S() && M() ? (t.addClass("timepicker-sbs"), "top" === n.toolbarPlacement && t.append(o), t.append(e("<div>").addClass("row").append(a.addClass("col-md-6")).append(r.addClass("col-md-6"))), "bottom" === n.toolbarPlacement && t.append(o), t) : ("top" === n.toolbarPlacement && i.append(o), S() && i.append(e("<li>").addClass(n.collapse && M() ? "collapse show" : "").append(a)), "default" === n.toolbarPlacement && i.append(o), M() && i.append(e("<li>").addClass(n.collapse && S() ? "collapse" : "").append(r)), "bottom" === n.toolbarPlacement && i.append(o), t.append(i))
  182. },
  183. Y = function () {
  184. var t, r = (f || a).position(),
  185. i = (f || a).offset(),
  186. o = n.widgetPositioning.vertical,
  187. s = n.widgetPositioning.horizontal;
  188. if (n.widgetParent) t = n.widgetParent.append(m);
  189. else if (a.is("input")) t = a.after(m).parent();
  190. else {
  191. if (n.inline) return void (t = a.append(m));
  192. t = a, a.children().first().after(m)
  193. }
  194. if ("auto" === o && (o = i.top + 1.5 * m.height() >= e(window).height() + e(window).scrollTop() && m.height() + a.outerHeight() < i.top ? "top" : "bottom"), "auto" === s && (s = t.width() < i.left + m.outerWidth() / 2 && i.left + m.outerWidth() > e(window).width() ? "right" : "left"), "top" === o ? m.addClass("top").removeClass("bottom") : m.addClass("bottom").removeClass("top"), "right" === s ? m.addClass("pull-right") : m.removeClass("pull-right"), "static" === t.css("position") && (t = t.parents().filter(function () {
  195. return "static" !== e(this).css("position")
  196. }).first()), 0 === t.length) throw new Error("datetimepicker component should be placed within a non-static positioned container");
  197. m.css({
  198. top: "top" === o ? "auto" : r.top + a.outerHeight(),
  199. bottom: "top" === o ? t.outerHeight() - (t === a ? 0 : r.top) : "auto",
  200. left: "left" === s ? t === a ? 0 : r.left : "auto",
  201. right: "left" === s ? "auto" : t.outerWidth() - a.outerWidth() - (t === a ? 0 : r.left)
  202. })
  203. },
  204. q = function (e) {
  205. "dp.change" === e.type && (e.date && e.date.isSame(e.oldDate) || !e.date && !e.oldDate) || a.trigger(e)
  206. },
  207. B = function (e) {
  208. "y" === e && (e = "YYYY"), q({
  209. type: "dp.update",
  210. change: e,
  211. viewDate: i.clone()
  212. })
  213. },
  214. j = function (e) {
  215. m && (e && (p = Math.max(h, Math.min(3, p + e))), m.find(".datepicker > div").hide().filter(".datepicker-" + y[p].clsName).show())
  216. },
  217. A = function () {
  218. var t = e("<tr>"),
  219. a = i.clone().startOf("w").startOf("d");
  220. for (!0 === n.calendarWeeks && t.append(e("<th>").addClass("cw").text("#")); a.isBefore(i.clone().endOf("w"));) t.append(e("<th>").addClass("dow").text(a.format("dd"))), a.add(1, "d");
  221. m.find(".datepicker-days thead").append(t)
  222. },
  223. F = function (e) {
  224. return !0 === n.disabledDates[e.format("YYYY-MM-DD")]
  225. },
  226. L = function (e) {
  227. return !0 === n.enabledDates[e.format("YYYY-MM-DD")]
  228. },
  229. W = function (e) {
  230. return !0 === n.disabledHours[e.format("H")]
  231. },
  232. z = function (e) {
  233. return !0 === n.enabledHours[e.format("H")]
  234. },
  235. N = function (t, a) {
  236. if (!t.isValid()) return !1;
  237. if (n.disabledDates && "d" === a && F(t)) return !1;
  238. if (n.enabledDates && "d" === a && !L(t)) return !1;
  239. if (n.minDate && t.isBefore(n.minDate, a)) return !1;
  240. if (n.maxDate && t.isAfter(n.maxDate, a)) return !1;
  241. if (n.daysOfWeekDisabled && "d" === a && -1 !== n.daysOfWeekDisabled.indexOf(t.day())) return !1;
  242. if (n.disabledHours && ("h" === a || "m" === a || "s" === a) && W(t)) return !1;
  243. if (n.enabledHours && ("h" === a || "m" === a || "s" === a) && !z(t)) return !1;
  244. if (n.disabledTimeIntervals && ("h" === a || "m" === a || "s" === a)) {
  245. var r = !1;
  246. if (e.each(n.disabledTimeIntervals, function () {
  247. if (t.isBetween(this[0], this[1])) return r = !0, !1
  248. }), r) return !1
  249. }
  250. return !0
  251. },
  252. V = function () {
  253. for (var t = [], a = i.clone().startOf("y").startOf("d"); a.isSame(i, "y");) t.push(e("<span>").attr("data-action", "selectMonth").addClass("month").text(a.format("MMM"))), a.add(1, "M");
  254. m.find(".datepicker-months td").empty().append(t)
  255. },
  256. Z = function () {
  257. var t = m.find(".datepicker-months"),
  258. a = t.find("th"),
  259. o = t.find("tbody").find("span");
  260. a.eq(0).find("span").attr("title", n.tooltips.prevYear), a.eq(1).attr("title", n.tooltips.selectYear), a.eq(2).find("span").attr("title", n.tooltips.nextYear), t.find(".disabled").removeClass("disabled"), N(i.clone().subtract(1, "y"), "y") || a.eq(0).addClass("disabled"), a.eq(1).text(i.year()), N(i.clone().add(1, "y"), "y") || a.eq(2).addClass("disabled"), o.removeClass("active"), r.isSame(i, "y") && !u && o.eq(r.month()).addClass("active"), o.each(function (t) {
  261. N(i.clone().month(t), "M") || e(this).addClass("disabled")
  262. })
  263. },
  264. R = function () {
  265. var e = m.find(".datepicker-years"),
  266. t = e.find("th"),
  267. a = i.clone().subtract(5, "y"),
  268. o = i.clone().add(6, "y"),
  269. s = "";
  270. for (t.eq(0).find("span").attr("title", n.tooltips.prevDecade), t.eq(1).attr("title", n.tooltips.selectDecade), t.eq(2).find("span").attr("title", n.tooltips.nextDecade), e.find(".disabled").removeClass("disabled"), n.minDate && n.minDate.isAfter(a, "y") && t.eq(0).addClass("disabled"), t.eq(1).text(a.year() + "-" + o.year()), n.maxDate && n.maxDate.isBefore(o, "y") && t.eq(2).addClass("disabled"); !a.isAfter(o, "y");) s += '<span data-action="selectYear" class="year' + (a.isSame(r, "y") && !u ? " active" : "") + (N(a, "y") ? "" : " disabled") + '">' + a.year() + "</span>", a.add(1, "y");
  271. e.find("td").html(s)
  272. },
  273. Q = function () {
  274. var e, a = m.find(".datepicker-decades"),
  275. o = a.find("th"),
  276. s = t({
  277. y: i.year() - i.year() % 100 - 1
  278. }),
  279. d = s.clone().add(100, "y"),
  280. l = s.clone(),
  281. p = !1,
  282. c = !1,
  283. u = "";
  284. for (o.eq(0).find("span").attr("title", n.tooltips.prevCentury), o.eq(2).find("span").attr("title", n.tooltips.nextCentury), a.find(".disabled").removeClass("disabled"), (s.isSame(t({
  285. y: 1900
  286. })) || n.minDate && n.minDate.isAfter(s, "y")) && o.eq(0).addClass("disabled"), o.eq(1).text(s.year() + "-" + d.year()), (s.isSame(t({
  287. y: 2e3
  288. })) || n.maxDate && n.maxDate.isBefore(d, "y")) && o.eq(2).addClass("disabled"); !s.isAfter(d, "y");) e = s.year() + 12, p = n.minDate && n.minDate.isAfter(s, "y") && n.minDate.year() <= e, c = n.maxDate && n.maxDate.isAfter(s, "y") && n.maxDate.year() <= e, u += '<span data-action="selectDecade" class="decade' + (r.isAfter(s) && r.year() <= e ? " active" : "") + (N(s, "y") || p || c ? "" : " disabled") + '" data-selection="' + (s.year() + 6) + '">' + (s.year() + 1) + " - " + (s.year() + 12) + "</span>", s.add(12, "y");
  289. u += "<span></span><span></span><span></span>", a.find("td").html(u), o.eq(1).text(l.year() + 1 + "-" + s.year())
  290. },
  291. U = function () {
  292. var t, a, o, s = m.find(".datepicker-days"),
  293. d = s.find("th"),
  294. l = [],
  295. p = [];
  296. if (S()) {
  297. for (d.eq(0).find("span").attr("title", n.tooltips.prevMonth), d.eq(1).attr("title", n.tooltips.selectMonth), d.eq(2).find("span").attr("title", n.tooltips.nextMonth), s.find(".disabled").removeClass("disabled"), d.eq(1).text(i.format(n.dayViewHeaderFormat)), N(i.clone().subtract(1, "M"), "M") || d.eq(0).addClass("disabled"), N(i.clone().add(1, "M"), "M") || d.eq(2).addClass("disabled"), t = i.clone().startOf("M").startOf("w").startOf("d"), o = 0; o < 42; o++) 0 === t.weekday() && (a = e("<tr>"), n.calendarWeeks && a.append('<td class="cw">' + t.week() + "</td>"), l.push(a)), p = ["day"], t.isBefore(i, "M") && p.push("old"), t.isAfter(i, "M") && p.push("new"), t.isSame(r, "d") && !u && p.push("active"), N(t, "d") || p.push("disabled"), t.isSame(x(), "d") && p.push("today"), 0 !== t.day() && 6 !== t.day() || p.push("weekend"), q({
  298. type: "dp.classify",
  299. date: t,
  300. classNames: p
  301. }), a.append('<td data-action="selectDay" data-day="' + t.format("L") + '" class="' + p.join(" ") + '">' + t.date() + "</td>"), t.add(1, "d");
  302. s.find("tbody").empty().append(l), Z(), R(), Q()
  303. }
  304. },
  305. G = function () {
  306. var t = m.find(".timepicker-hours table"),
  307. a = i.clone().startOf("d"),
  308. n = [],
  309. r = e("<tr>");
  310. for (i.hour() > 11 && !s && a.hour(12); a.isSame(i, "d") && (s || i.hour() < 12 && a.hour() < 12 || i.hour() > 11);) a.hour() % 4 == 0 && (r = e("<tr>"), n.push(r)), r.append('<td data-action="selectHour" class="hour' + (N(a, "h") ? "" : " disabled") + '">' + a.format(s ? "HH" : "hh") + "</td>"), a.add(1, "h");
  311. t.empty().append(n)
  312. },
  313. J = function () {
  314. for (var t = m.find(".timepicker-minutes table"), a = i.clone().startOf("h"), r = [], o = e("<tr>"), s = 1 === n.stepping ? 5 : n.stepping; i.isSame(a, "h");) a.minute() % (4 * s) == 0 && (o = e("<tr>"), r.push(o)), o.append('<td data-action="selectMinute" class="minute' + (N(a, "m") ? "" : " disabled") + '">' + a.format("mm") + "</td>"), a.add(s, "m");
  315. t.empty().append(r)
  316. },
  317. K = function () {
  318. for (var t = m.find(".timepicker-seconds table"), a = i.clone().startOf("m"), n = [], r = e("<tr>"); i.isSame(a, "m");) a.second() % 20 == 0 && (r = e("<tr>"), n.push(r)), r.append('<td data-action="selectSecond" class="second' + (N(a, "s") ? "" : " disabled") + '">' + a.format("ss") + "</td>"), a.add(5, "s");
  319. t.empty().append(n)
  320. },
  321. X = function () {
  322. var e, t, a = m.find(".timepicker span[data-time-component]");
  323. s || (e = m.find(".timepicker [data-action=togglePeriod]"), t = r.clone().add(r.hours() >= 12 ? -12 : 12, "h"), e.text(r.format("A")), N(t, "h") ? e.removeClass("disabled") : e.addClass("disabled")), a.filter("[data-time-component=hours]").text(r.format(s ? "HH" : "hh")), a.filter("[data-time-component=minutes]").text(r.format("mm")), a.filter("[data-time-component=seconds]").text(r.format("ss")), G(), J(), K()
  324. },
  325. $ = function () {
  326. m && (U(), X())
  327. },
  328. _ = function (e) {
  329. var t = u ? null : r;
  330. if (!e) return u = !0, o.val(""), a.data("date", ""), q({
  331. type: "dp.change",
  332. date: !1,
  333. oldDate: t
  334. }), void $();
  335. if (e = e.clone().locale(n.locale), C() && e.tz(n.timeZone), 1 !== n.stepping)
  336. for (e.minutes(Math.round(e.minutes() / n.stepping) * n.stepping).seconds(0); n.minDate && e.isBefore(n.minDate);) e.add(n.stepping, "minutes");
  337. N(e) ? (i = (r = e).clone(), o.val(r.format(d)), a.data("date", r.format(d)), u = !1, $(), q({
  338. type: "dp.change",
  339. date: r.clone(),
  340. oldDate: t
  341. })) : (n.keepInvalid ? q({
  342. type: "dp.change",
  343. date: e,
  344. oldDate: t
  345. }) : o.val(u ? "" : r.format(d)), q({
  346. type: "dp.error",
  347. date: e,
  348. oldDate: t
  349. }))
  350. },
  351. ee = function () {
  352. var t = !1;
  353. return m ? (m.find(".collapse").each(function () {
  354. var a = e(this).data("collapse");
  355. return !a || !a.transitioning || (t = !0, !1)
  356. }), t ? c : (f && f.hasClass("btn") && f.toggleClass("active"), m.hide(), e(window).off("resize", Y), m.off("click", "[data-action]"), m.off("mousedown", !1), m.remove(), m = !1, q({
  357. type: "dp.hide",
  358. date: r.clone()
  359. }), o.blur(), i = r.clone(), c)) : c
  360. },
  361. te = function () {
  362. _(null)
  363. },
  364. ae = function (e) {
  365. return void 0 === n.parseInputDate ? (!t.isMoment(e) || e instanceof Date) && (e = x(e)) : e = n.parseInputDate(e), e
  366. },
  367. ne = {
  368. next: function () {
  369. var e = y[p].navFnc;
  370. i.add(y[p].navStep, e), U(), B(e)
  371. },
  372. previous: function () {
  373. var e = y[p].navFnc;
  374. i.subtract(y[p].navStep, e), U(), B(e)
  375. },
  376. pickerSwitch: function () {
  377. j(1)
  378. },
  379. selectMonth: function (t) {
  380. var a = e(t.target).closest("tbody").find("span").index(e(t.target));
  381. i.month(a), p === h ? (_(r.clone().year(i.year()).month(i.month())), n.inline || ee()) : (j(-1), U()), B("M")
  382. },
  383. selectYear: function (t) {
  384. var a = parseInt(e(t.target).text(), 10) || 0;
  385. i.year(a), p === h ? (_(r.clone().year(i.year())), n.inline || ee()) : (j(-1), U()), B("YYYY")
  386. },
  387. selectDecade: function (t) {
  388. var a = parseInt(e(t.target).data("selection"), 10) || 0;
  389. i.year(a), p === h ? (_(r.clone().year(i.year())), n.inline || ee()) : (j(-1), U()), B("YYYY")
  390. },
  391. selectDay: function (t) {
  392. var a = i.clone();
  393. e(t.target).is(".old") && a.subtract(1, "M"), e(t.target).is(".new") && a.add(1, "M"), _(a.date(parseInt(e(t.target).text(), 10))), M() || n.keepOpen || n.inline || ee()
  394. },
  395. incrementHours: function () {
  396. var e = r.clone().add(1, "h");
  397. N(e, "h") && _(e)
  398. },
  399. incrementMinutes: function () {
  400. var e = r.clone().add(n.stepping, "m");
  401. N(e, "m") && _(e)
  402. },
  403. incrementSeconds: function () {
  404. var e = r.clone().add(1, "s");
  405. N(e, "s") && _(e)
  406. },
  407. decrementHours: function () {
  408. var e = r.clone().subtract(1, "h");
  409. N(e, "h") && _(e)
  410. },
  411. decrementMinutes: function () {
  412. var e = r.clone().subtract(n.stepping, "m");
  413. N(e, "m") && _(e)
  414. },
  415. decrementSeconds: function () {
  416. var e = r.clone().subtract(1, "s");
  417. N(e, "s") && _(e)
  418. },
  419. togglePeriod: function () {
  420. _(r.clone().add(r.hours() >= 12 ? -12 : 12, "h"))
  421. },
  422. togglePicker: function (t) {
  423. var a, r = e(t.target),
  424. i = r.closest("ul"),
  425. o = i.find(".show"),
  426. s = i.find(".collapse:not(.show)");
  427. if (o && o.length) {
  428. if ((a = o.data("collapse")) && a.transitioning) return;
  429. o.collapse ? (o.collapse("hide"), s.collapse("show")) : (o.removeClass("show"), s.addClass("show")), r.is("i") ? r.toggleClass(n.icons.time + " " + n.icons.date) : r.find("i").toggleClass(n.icons.time + " " + n.icons.date)
  430. }
  431. },
  432. showPicker: function () {
  433. m.find(".timepicker > div:not(.timepicker-picker)").hide(), m.find(".timepicker .timepicker-picker").show()
  434. },
  435. showHours: function () {
  436. m.find(".timepicker .timepicker-picker").hide(), m.find(".timepicker .timepicker-hours").show()
  437. },
  438. showMinutes: function () {
  439. m.find(".timepicker .timepicker-picker").hide(), m.find(".timepicker .timepicker-minutes").show()
  440. },
  441. showSeconds: function () {
  442. m.find(".timepicker .timepicker-picker").hide(), m.find(".timepicker .timepicker-seconds").show()
  443. },
  444. selectHour: function (t) {
  445. var a = parseInt(e(t.target).text(), 10);
  446. s || (r.hours() >= 12 ? 12 !== a && (a += 12) : 12 === a && (a = 0)), _(r.clone().hours(a)), ne.showPicker.call(c)
  447. },
  448. selectMinute: function (t) {
  449. _(r.clone().minutes(parseInt(e(t.target).text(), 10))), ne.showPicker.call(c)
  450. },
  451. selectSecond: function (t) {
  452. _(r.clone().seconds(parseInt(e(t.target).text(), 10))), ne.showPicker.call(c)
  453. },
  454. clear: te,
  455. today: function () {
  456. var e = x();
  457. N(e, "d") && _(e)
  458. },
  459. close: ee
  460. },
  461. re = function (t) {
  462. return !e(t.currentTarget).is(".disabled") && (ne[e(t.currentTarget).data("action")].apply(c, arguments), !1)
  463. },
  464. ie = function () {
  465. var t, a = {
  466. year: function (e) {
  467. return e.month(0).date(1).hours(0).seconds(0).minutes(0)
  468. },
  469. month: function (e) {
  470. return e.date(1).hours(0).seconds(0).minutes(0)
  471. },
  472. day: function (e) {
  473. return e.hours(0).seconds(0).minutes(0)
  474. },
  475. hour: function (e) {
  476. return e.seconds(0).minutes(0)
  477. },
  478. minute: function (e) {
  479. return e.seconds(0)
  480. }
  481. };
  482. return o.prop("disabled") || !n.ignoreReadonly && o.prop("readonly") || m ? c : (void 0 !== o.val() && 0 !== o.val().trim().length ? _(ae(o.val().trim())) : u && n.useCurrent && (n.inline || o.is("input") && 0 === o.val().trim().length) && (t = x(), "string" == typeof n.useCurrent && (t = a[n.useCurrent](t)), _(t)), m = I(), A(), V(), m.find(".timepicker-hours").hide(), m.find(".timepicker-minutes").hide(), m.find(".timepicker-seconds").hide(), $(), j(), e(window).on("resize", Y), m.on("click", "[data-action]", re), m.on("mousedown", !1), f && f.hasClass("btn") && f.toggleClass("active"), Y(), m.show(), n.focusOnShow && !o.is(":focus") && o.focus(), q({
  483. type: "dp.show"
  484. }), c)
  485. },
  486. oe = function () {
  487. return m ? ee() : ie()
  488. },
  489. se = function (e) {
  490. var t, a, r, i, o = null,
  491. s = [],
  492. d = {},
  493. l = e.which;
  494. D[l] = "p";
  495. for (t in D) D.hasOwnProperty(t) && "p" === D[t] && (s.push(t), parseInt(t, 10) !== l && (d[t] = !0));
  496. for (t in n.keyBinds)
  497. if (n.keyBinds.hasOwnProperty(t) && "function" == typeof n.keyBinds[t] && (r = t.split(" ")).length === s.length && k[l] === r[r.length - 1]) {
  498. for (i = !0, a = r.length - 2; a >= 0; a--)
  499. if (!(k[r[a]] in d)) {
  500. i = !1;
  501. break
  502. }
  503. if (i) {
  504. o = n.keyBinds[t];
  505. break
  506. }
  507. }
  508. o && (o.call(c, m), e.stopPropagation(), e.preventDefault())
  509. },
  510. de = function (e) {
  511. D[e.which] = "r", e.stopPropagation(), e.preventDefault()
  512. },
  513. le = function (t) {
  514. var a = e(t.target).val().trim(),
  515. n = a ? ae(a) : null;
  516. return _(n), t.stopImmediatePropagation(), !1
  517. },
  518. pe = function () {
  519. o.off({
  520. change: le,
  521. blur: blur,
  522. keydown: se,
  523. keyup: de,
  524. focus: n.allowInputToggle ? ee : ""
  525. }), a.is("input") ? o.off({
  526. focus: ie
  527. }) : f && (f.off("click", oe), f.off("mousedown", !1))
  528. },
  529. ce = function (t) {
  530. var a = {};
  531. return e.each(t, function () {
  532. var e = ae(this);
  533. e.isValid() && (a[e.format("YYYY-MM-DD")] = !0)
  534. }), !!Object.keys(a).length && a
  535. },
  536. ue = function (t) {
  537. var a = {};
  538. return e.each(t, function () {
  539. a[this] = !0
  540. }), !!Object.keys(a).length && a
  541. },
  542. fe = function () {
  543. var e = n.format || "L LT";
  544. d = e.replace(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, function (e) {
  545. return (r.localeData().longDateFormat(e) || e).replace(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, function (e) {
  546. return r.localeData().longDateFormat(e) || e
  547. })
  548. }), (l = n.extraFormats ? n.extraFormats.slice() : []).indexOf(e) < 0 && l.indexOf(d) < 0 && l.push(d), s = d.toLowerCase().indexOf("a") < 1 && d.replace(/\[.*?\]/g, "").indexOf("h") < 1, T("y") && (h = 2), T("M") && (h = 1), T("d") && (h = 0), p = Math.max(h, p), u || _(r)
  549. };
  550. if (c.destroy = function () {
  551. ee(), pe(), a.removeData("DateTimePicker"), a.removeData("date")
  552. }, c.toggle = oe, c.show = ie, c.hide = ee, c.disable = function () {
  553. return ee(), f && f.hasClass("btn") && f.addClass("disabled"), o.prop("disabled", !0), c
  554. }, c.enable = function () {
  555. return f && f.hasClass("btn") && f.removeClass("disabled"), o.prop("disabled", !1), c
  556. }, c.ignoreReadonly = function (e) {
  557. if (0 === arguments.length) return n.ignoreReadonly;
  558. if ("boolean" != typeof e) throw new TypeError("ignoreReadonly () expects a boolean parameter");
  559. return n.ignoreReadonly = e, c
  560. }, c.options = function (t) {
  561. if (0 === arguments.length) return e.extend(!0, {}, n);
  562. if (!(t instanceof Object)) throw new TypeError("options() options parameter should be an object");
  563. return e.extend(!0, n, t), e.each(n, function (e, t) {
  564. if (void 0 === c[e]) throw new TypeError("option " + e + " is not recognized!");
  565. c[e](t)
  566. }), c
  567. }, c.date = function (e) {
  568. if (0 === arguments.length) return u ? null : r.clone();
  569. if (!(null === e || "string" == typeof e || t.isMoment(e) || e instanceof Date)) throw new TypeError("date() parameter must be one of [null, string, moment or Date]");
  570. return _(null === e ? null : ae(e)), c
  571. }, c.format = function (e) {
  572. if (0 === arguments.length) return n.format;
  573. if ("string" != typeof e && ("boolean" != typeof e || !1 !== e)) throw new TypeError("format() expects a string or boolean:false parameter " + e);
  574. return n.format = e, d && fe(), c
  575. }, c.timeZone = function (e) {
  576. if (0 === arguments.length) return n.timeZone;
  577. if ("string" != typeof e) throw new TypeError("newZone() expects a string parameter");
  578. return n.timeZone = e, c
  579. }, c.dayViewHeaderFormat = function (e) {
  580. if (0 === arguments.length) return n.dayViewHeaderFormat;
  581. if ("string" != typeof e) throw new TypeError("dayViewHeaderFormat() expects a string parameter");
  582. return n.dayViewHeaderFormat = e, c
  583. }, c.extraFormats = function (e) {
  584. if (0 === arguments.length) return n.extraFormats;
  585. if (!1 !== e && !(e instanceof Array)) throw new TypeError("extraFormats() expects an array or false parameter");
  586. return n.extraFormats = e, l && fe(), c
  587. }, c.disabledDates = function (t) {
  588. if (0 === arguments.length) return n.disabledDates ? e.extend({}, n.disabledDates) : n.disabledDates;
  589. if (!t) return n.disabledDates = !1, $(), c;
  590. if (!(t instanceof Array)) throw new TypeError("disabledDates() expects an array parameter");
  591. return n.disabledDates = ce(t), n.enabledDates = !1, $(), c
  592. }, c.enabledDates = function (t) {
  593. if (0 === arguments.length) return n.enabledDates ? e.extend({}, n.enabledDates) : n.enabledDates;
  594. if (!t) return n.enabledDates = !1, $(), c;
  595. if (!(t instanceof Array)) throw new TypeError("enabledDates() expects an array parameter");
  596. return n.enabledDates = ce(t), n.disabledDates = !1, $(), c
  597. }, c.daysOfWeekDisabled = function (e) {
  598. if (0 === arguments.length) return n.daysOfWeekDisabled.splice(0);
  599. if ("boolean" == typeof e && !e) return n.daysOfWeekDisabled = !1, $(), c;
  600. if (!(e instanceof Array)) throw new TypeError("daysOfWeekDisabled() expects an array parameter");
  601. if (n.daysOfWeekDisabled = e.reduce(function (e, t) {
  602. return (t = parseInt(t, 10)) > 6 || t < 0 || isNaN(t) ? e : (-1 === e.indexOf(t) && e.push(t), e)
  603. }, []).sort(), n.useCurrent && !n.keepInvalid) {
  604. for (var t = 0; !N(r, "d");) {
  605. if (r.add(1, "d"), 31 === t) throw "Tried 31 times to find a valid date";
  606. t++
  607. }
  608. _(r)
  609. }
  610. return $(), c
  611. }, c.maxDate = function (e) {
  612. if (0 === arguments.length) return n.maxDate ? n.maxDate.clone() : n.maxDate;
  613. if ("boolean" == typeof e && !1 === e) return n.maxDate = !1, $(), c;
  614. "string" == typeof e && ("now" !== e && "moment" !== e || (e = x()));
  615. var t = ae(e);
  616. if (!t.isValid()) throw new TypeError("maxDate() Could not parse date parameter: " + e);
  617. if (n.minDate && t.isBefore(n.minDate)) throw new TypeError("maxDate() date parameter is before options.minDate: " + t.format(d));
  618. return n.maxDate = t, n.useCurrent && !n.keepInvalid && r.isAfter(e) && _(n.maxDate), i.isAfter(t) && (i = t.clone().subtract(n.stepping, "m")), $(), c
  619. }, c.minDate = function (e) {
  620. if (0 === arguments.length) return n.minDate ? n.minDate.clone() : n.minDate;
  621. if ("boolean" == typeof e && !1 === e) return n.minDate = !1, $(), c;
  622. "string" == typeof e && ("now" !== e && "moment" !== e || (e = x()));
  623. var t = ae(e);
  624. if (!t.isValid()) throw new TypeError("minDate() Could not parse date parameter: " + e);
  625. if (n.maxDate && t.isAfter(n.maxDate)) throw new TypeError("minDate() date parameter is after options.maxDate: " + t.format(d));
  626. return n.minDate = t, n.useCurrent && !n.keepInvalid && r.isBefore(e) && _(n.minDate), i.isBefore(t) && (i = t.clone().add(n.stepping, "m")), $(), c
  627. }, c.defaultDate = function (e) {
  628. if (0 === arguments.length) return n.defaultDate ? n.defaultDate.clone() : n.defaultDate;
  629. if (!e) return n.defaultDate = !1, c;
  630. "string" == typeof e && (e = "now" === e || "moment" === e ? x() : x(e));
  631. var t = ae(e);
  632. if (!t.isValid()) throw new TypeError("defaultDate() Could not parse date parameter: " + e);
  633. if (!N(t)) throw new TypeError("defaultDate() date passed is invalid according to component setup validations");
  634. return n.defaultDate = t, (n.defaultDate && n.inline || "" === o.val().trim()) && _(n.defaultDate), c
  635. }, c.locale = function (e) {
  636. if (0 === arguments.length) return n.locale;
  637. if (!t.localeData(e)) throw new TypeError("locale() locale " + e + " is not loaded from moment locales!");
  638. return n.locale = e, r.locale(n.locale), i.locale(n.locale), d && fe(), m && (ee(), ie()), c
  639. }, c.stepping = function (e) {
  640. return 0 === arguments.length ? n.stepping : (e = parseInt(e, 10), (isNaN(e) || e < 1) && (e = 1), n.stepping = e, c)
  641. }, c.useCurrent = function (e) {
  642. var t = ["year", "month", "day", "hour", "minute"];
  643. if (0 === arguments.length) return n.useCurrent;
  644. if ("boolean" != typeof e && "string" != typeof e) throw new TypeError("useCurrent() expects a boolean or string parameter");
  645. if ("string" == typeof e && -1 === t.indexOf(e.toLowerCase())) throw new TypeError("useCurrent() expects a string parameter of " + t.join(", "));
  646. return n.useCurrent = e, c
  647. }, c.collapse = function (e) {
  648. if (0 === arguments.length) return n.collapse;
  649. if ("boolean" != typeof e) throw new TypeError("collapse() expects a boolean parameter");
  650. return n.collapse === e ? c : (n.collapse = e, m && (ee(), ie()), c)
  651. }, c.icons = function (t) {
  652. if (0 === arguments.length) return e.extend({}, n.icons);
  653. if (!(t instanceof Object)) throw new TypeError("icons() expects parameter to be an Object");
  654. return e.extend(n.icons, t), m && (ee(), ie()), c
  655. }, c.tooltips = function (t) {
  656. if (0 === arguments.length) return e.extend({}, n.tooltips);
  657. if (!(t instanceof Object)) throw new TypeError("tooltips() expects parameter to be an Object");
  658. return e.extend(n.tooltips, t), m && (ee(), ie()), c
  659. }, c.useStrict = function (e) {
  660. if (0 === arguments.length) return n.useStrict;
  661. if ("boolean" != typeof e) throw new TypeError("useStrict() expects a boolean parameter");
  662. return n.useStrict = e, c
  663. }, c.sideBySide = function (e) {
  664. if (0 === arguments.length) return n.sideBySide;
  665. if ("boolean" != typeof e) throw new TypeError("sideBySide() expects a boolean parameter");
  666. return n.sideBySide = e, m && (ee(), ie()), c
  667. }, c.viewMode = function (e) {
  668. if (0 === arguments.length) return n.viewMode;
  669. if ("string" != typeof e) throw new TypeError("viewMode() expects a string parameter");
  670. if (-1 === w.indexOf(e)) throw new TypeError("viewMode() parameter must be one of (" + w.join(", ") + ") value");
  671. return n.viewMode = e, p = Math.max(w.indexOf(e), h), j(), c
  672. }, c.toolbarPlacement = function (e) {
  673. if (0 === arguments.length) return n.toolbarPlacement;
  674. if ("string" != typeof e) throw new TypeError("toolbarPlacement() expects a string parameter");
  675. if (-1 === v.indexOf(e)) throw new TypeError("toolbarPlacement() parameter must be one of (" + v.join(", ") + ") value");
  676. return n.toolbarPlacement = e, m && (ee(), ie()), c
  677. }, c.widgetPositioning = function (t) {
  678. if (0 === arguments.length) return e.extend({}, n.widgetPositioning);
  679. if ("[object Object]" !== {}.toString.call(t)) throw new TypeError("widgetPositioning() expects an object variable");
  680. if (t.horizontal) {
  681. if ("string" != typeof t.horizontal) throw new TypeError("widgetPositioning() horizontal variable must be a string");
  682. if (t.horizontal = t.horizontal.toLowerCase(), -1 === g.indexOf(t.horizontal)) throw new TypeError("widgetPositioning() expects horizontal parameter to be one of (" + g.join(", ") + ")");
  683. n.widgetPositioning.horizontal = t.horizontal
  684. }
  685. if (t.vertical) {
  686. if ("string" != typeof t.vertical) throw new TypeError("widgetPositioning() vertical variable must be a string");
  687. if (t.vertical = t.vertical.toLowerCase(), -1 === b.indexOf(t.vertical)) throw new TypeError("widgetPositioning() expects vertical parameter to be one of (" + b.join(", ") + ")");
  688. n.widgetPositioning.vertical = t.vertical
  689. }
  690. return $(), c
  691. }, c.calendarWeeks = function (e) {
  692. if (0 === arguments.length) return n.calendarWeeks;
  693. if ("boolean" != typeof e) throw new TypeError("calendarWeeks() expects parameter to be a boolean value");
  694. return n.calendarWeeks = e, $(), c
  695. }, c.showTodayButton = function (e) {
  696. if (0 === arguments.length) return n.showTodayButton;
  697. if ("boolean" != typeof e) throw new TypeError("showTodayButton() expects a boolean parameter");
  698. return n.showTodayButton = e, m && (ee(), ie()), c
  699. }, c.showClear = function (e) {
  700. if (0 === arguments.length) return n.showClear;
  701. if ("boolean" != typeof e) throw new TypeError("showClear() expects a boolean parameter");
  702. return n.showClear = e, m && (ee(), ie()), c
  703. }, c.widgetParent = function (t) {
  704. if (0 === arguments.length) return n.widgetParent;
  705. if ("string" == typeof t && (t = e(t)), null !== t && "string" != typeof t && !(t instanceof e)) throw new TypeError("widgetParent() expects a string or a jQuery object parameter");
  706. return n.widgetParent = t, m && (ee(), ie()), c
  707. }, c.keepOpen = function (e) {
  708. if (0 === arguments.length) return n.keepOpen;
  709. if ("boolean" != typeof e) throw new TypeError("keepOpen() expects a boolean parameter");
  710. return n.keepOpen = e, c
  711. }, c.focusOnShow = function (e) {
  712. if (0 === arguments.length) return n.focusOnShow;
  713. if ("boolean" != typeof e) throw new TypeError("focusOnShow() expects a boolean parameter");
  714. return n.focusOnShow = e, c
  715. }, c.inline = function (e) {
  716. if (0 === arguments.length) return n.inline;
  717. if ("boolean" != typeof e) throw new TypeError("inline() expects a boolean parameter");
  718. return n.inline = e, c
  719. }, c.clear = function () {
  720. return te(), c
  721. }, c.keyBinds = function (e) {
  722. return 0 === arguments.length ? n.keyBinds : (n.keyBinds = e, c)
  723. }, c.getMoment = function (e) {
  724. return x(e)
  725. }, c.debug = function (e) {
  726. if ("boolean" != typeof e) throw new TypeError("debug() expects a boolean parameter");
  727. return n.debug = e, c
  728. }, c.allowInputToggle = function (e) {
  729. if (0 === arguments.length) return n.allowInputToggle;
  730. if ("boolean" != typeof e) throw new TypeError("allowInputToggle() expects a boolean parameter");
  731. return n.allowInputToggle = e, c
  732. }, c.showClose = function (e) {
  733. if (0 === arguments.length) return n.showClose;
  734. if ("boolean" != typeof e) throw new TypeError("showClose() expects a boolean parameter");
  735. return n.showClose = e, c
  736. }, c.keepInvalid = function (e) {
  737. if (0 === arguments.length) return n.keepInvalid;
  738. if ("boolean" != typeof e) throw new TypeError("keepInvalid() expects a boolean parameter");
  739. return n.keepInvalid = e, c
  740. }, c.datepickerInput = function (e) {
  741. if (0 === arguments.length) return n.datepickerInput;
  742. if ("string" != typeof e) throw new TypeError("datepickerInput() expects a string parameter");
  743. return n.datepickerInput = e, c
  744. }, c.parseInputDate = function (e) {
  745. if (0 === arguments.length) return n.parseInputDate;
  746. if ("function" != typeof e) throw new TypeError("parseInputDate() sholud be as function");
  747. return n.parseInputDate = e, c
  748. }, c.disabledTimeIntervals = function (t) {
  749. if (0 === arguments.length) return n.disabledTimeIntervals ? e.extend({}, n.disabledTimeIntervals) : n.disabledTimeIntervals;
  750. if (!t) return n.disabledTimeIntervals = !1, $(), c;
  751. if (!(t instanceof Array)) throw new TypeError("disabledTimeIntervals() expects an array parameter");
  752. return n.disabledTimeIntervals = t, $(), c
  753. }, c.disabledHours = function (t) {
  754. if (0 === arguments.length) return n.disabledHours ? e.extend({}, n.disabledHours) : n.disabledHours;
  755. if (!t) return n.disabledHours = !1, $(), c;
  756. if (!(t instanceof Array)) throw new TypeError("disabledHours() expects an array parameter");
  757. if (n.disabledHours = ue(t), n.enabledHours = !1, n.useCurrent && !n.keepInvalid) {
  758. for (var a = 0; !N(r, "h");) {
  759. if (r.add(1, "h"), 24 === a) throw "Tried 24 times to find a valid date";
  760. a++
  761. }
  762. _(r)
  763. }
  764. return $(), c
  765. }, c.enabledHours = function (t) {
  766. if (0 === arguments.length) return n.enabledHours ? e.extend({}, n.enabledHours) : n.enabledHours;
  767. if (!t) return n.enabledHours = !1, $(), c;
  768. if (!(t instanceof Array)) throw new TypeError("enabledHours() expects an array parameter");
  769. if (n.enabledHours = ue(t), n.disabledHours = !1, n.useCurrent && !n.keepInvalid) {
  770. for (var a = 0; !N(r, "h");) {
  771. if (r.add(1, "h"), 24 === a) throw "Tried 24 times to find a valid date";
  772. a++
  773. }
  774. _(r)
  775. }
  776. return $(), c
  777. }, c.viewDate = function (e) {
  778. if (0 === arguments.length) return i.clone();
  779. if (!e) return i = r.clone(), c;
  780. if (!("string" == typeof e || t.isMoment(e) || e instanceof Date)) throw new TypeError("viewDate() parameter must be one of [string, moment or Date]");
  781. return i = ae(e), B(), c
  782. }, a.is("input")) o = a;
  783. else if (0 === (o = a.find(n.datepickerInput)).length) o = a.find("input");
  784. else if (!o.is("input")) throw new Error('CSS class "' + n.datepickerInput + '" cannot be applied to non input element');
  785. if (a.hasClass("input-group") && (f = 0 === a.find(".datepickerbutton").length ? a.find(".input-group-text") : a.find(".datepickerbutton")), !n.inline && !o.is("input")) throw new Error("Could not initialize DateTimePicker without an input element");
  786. return r = x(), i = r.clone(), e.extend(!0, n, function () {
  787. var t, r = {};
  788. return (t = a.is("input") || n.inline ? a.data() : a.find("input").data()).dateOptions && t.dateOptions instanceof Object && (r = e.extend(!0, r, t.dateOptions)), e.each(n, function (e) {
  789. var a = "date" + e.charAt(0).toUpperCase() + e.slice(1);
  790. void 0 !== t[a] && (r[e] = t[a])
  791. }), r
  792. }()), c.options(n), fe(), o.on({
  793. change: le,
  794. blur: n.debug ? "" : ee,
  795. keydown: se,
  796. keyup: de,
  797. focus: n.allowInputToggle ? ie : ""
  798. }), a.is("input") ? o.on({
  799. focus: ie
  800. }) : f && (f.on("click", oe), f.on("mousedown", !1)), o.prop("disabled") && c.disable(), o.is("input") && 0 !== o.val().trim().length ? _(ae(o.val().trim())) : n.defaultDate && void 0 === o.attr("placeholder") && _(n.defaultDate), n.inline && ie(), c
  801. };
  802. return e.fn.datetimepicker = function (t) {
  803. t = t || {};
  804. var n, r = Array.prototype.slice.call(arguments, 1),
  805. i = !0,
  806. o = ["destroy", "hide", "show", "toggle"];
  807. if ("object" == typeof t) return this.each(function () {
  808. var n, r = e(this);
  809. r.data("DateTimePicker") || (n = e.extend(!0, {}, e.fn.datetimepicker.defaults, t), r.data("DateTimePicker", a(r, n)))
  810. });
  811. if ("string" == typeof t) return this.each(function () {
  812. var a = e(this).data("DateTimePicker");
  813. if (!a) throw new Error('bootstrap-datetimepicker("' + t + '") method was called on an element that is not using DateTimePicker');
  814. n = a[t].apply(a, r), i = n === a
  815. }), i || e.inArray(t, o) > -1 ? this : n;
  816. throw new TypeError("Invalid arguments for DateTimePicker: " + t)
  817. }, e.fn.datetimepicker.defaults = {
  818. timeZone: "",
  819. format: !1,
  820. dayViewHeaderFormat: "MMMM YYYY",
  821. extraFormats: !1,
  822. stepping: 1,
  823. minDate: !1,
  824. maxDate: !1,
  825. useCurrent: !0,
  826. collapse: !0,
  827. locale: t.locale(),
  828. defaultDate: !1,
  829. disabledDates: !1,
  830. enabledDates: !1,
  831. icons: {
  832. time: "fa fa-clock-o",
  833. date: "fa fa-calendar",
  834. up: "fa fa-chevron-up",
  835. down: "fa fa-chevron-down",
  836. previous: "fa fa-chevron-left",
  837. next: "fa fa-chevron-right",
  838. today: "fa fa-crosshairs",
  839. clear: "fa fa-trash-o",
  840. close: "fa fa-times"
  841. },
  842. tooltips: {
  843. today: "Go to today",
  844. clear: "Clear selection",
  845. close: "Close the picker",
  846. selectMonth: "Select Month",
  847. prevMonth: "Previous Month",
  848. nextMonth: "Next Month",
  849. selectYear: "Select Year",
  850. prevYear: "Previous Year",
  851. nextYear: "Next Year",
  852. selectDecade: "Select Decade",
  853. prevDecade: "Previous Decade",
  854. nextDecade: "Next Decade",
  855. prevCentury: "Previous Century",
  856. nextCentury: "Next Century",
  857. pickHour: "Pick Hour",
  858. incrementHour: "Increment Hour",
  859. decrementHour: "Decrement Hour",
  860. pickMinute: "Pick Minute",
  861. incrementMinute: "Increment Minute",
  862. decrementMinute: "Decrement Minute",
  863. pickSecond: "Pick Second",
  864. incrementSecond: "Increment Second",
  865. decrementSecond: "Decrement Second",
  866. togglePeriod: "Toggle Period",
  867. selectTime: "Select Time"
  868. },
  869. useStrict: !1,
  870. sideBySide: !1,
  871. daysOfWeekDisabled: !1,
  872. calendarWeeks: !1,
  873. viewMode: "days",
  874. toolbarPlacement: "default",
  875. showTodayButton: !1,
  876. showClear: !1,
  877. showClose: !1,
  878. widgetPositioning: {
  879. horizontal: "auto",
  880. vertical: "auto"
  881. },
  882. widgetParent: null,
  883. ignoreReadonly: !1,
  884. keepOpen: !1,
  885. focusOnShow: !0,
  886. inline: !1,
  887. keepInvalid: !1,
  888. datepickerInput: ".datepickerinput",
  889. keyBinds: {
  890. up: function (e) {
  891. if (e) {
  892. var t = this.date() || this.getMoment();
  893. e.find(".datepicker").is(":visible") ? this.date(t.clone().subtract(7, "d")) : this.date(t.clone().add(this.stepping(), "m"))
  894. }
  895. },
  896. down: function (e) {
  897. if (e) {
  898. var t = this.date() || this.getMoment();
  899. e.find(".datepicker").is(":visible") ? this.date(t.clone().add(7, "d")) : this.date(t.clone().subtract(this.stepping(), "m"))
  900. } else this.show()
  901. },
  902. "control up": function (e) {
  903. if (e) {
  904. var t = this.date() || this.getMoment();
  905. e.find(".datepicker").is(":visible") ? this.date(t.clone().subtract(1, "y")) : this.date(t.clone().add(1, "h"))
  906. }
  907. },
  908. "control down": function (e) {
  909. if (e) {
  910. var t = this.date() || this.getMoment();
  911. e.find(".datepicker").is(":visible") ? this.date(t.clone().add(1, "y")) : this.date(t.clone().subtract(1, "h"))
  912. }
  913. },
  914. left: function (e) {
  915. if (e) {
  916. var t = this.date() || this.getMoment();
  917. e.find(".datepicker").is(":visible") && this.date(t.clone().subtract(1, "d"))
  918. }
  919. },
  920. right: function (e) {
  921. if (e) {
  922. var t = this.date() || this.getMoment();
  923. e.find(".datepicker").is(":visible") && this.date(t.clone().add(1, "d"))
  924. }
  925. },
  926. pageUp: function (e) {
  927. if (e) {
  928. var t = this.date() || this.getMoment();
  929. e.find(".datepicker").is(":visible") && this.date(t.clone().subtract(1, "M"))
  930. }
  931. },
  932. pageDown: function (e) {
  933. if (e) {
  934. var t = this.date() || this.getMoment();
  935. e.find(".datepicker").is(":visible") && this.date(t.clone().add(1, "M"))
  936. }
  937. },
  938. enter: function () {
  939. this.hide()
  940. },
  941. escape: function () {
  942. this.hide()
  943. },
  944. "control space": function (e) {
  945. e && e.find(".timepicker").is(":visible") && e.find('.btn[data-action="togglePeriod"]').click()
  946. },
  947. t: function () {
  948. this.date(this.getMoment())
  949. },
  950. delete: function () {
  951. this.clear()
  952. }
  953. },
  954. debug: !1,
  955. allowInputToggle: !1,
  956. disabledTimeIntervals: !1,
  957. disabledHours: !1,
  958. enabledHours: !1,
  959. viewDate: !1
  960. }, e.fn.datetimepicker
  961. });