inviton-powerduck 0.0.154 → 0.0.155

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/app/powerduck-initializer.ts +3 -3
  2. package/common/api-http.ts +20 -14
  3. package/common/css/ladda-themeless-zoomin.min.css +89 -89
  4. package/common/enum-translation/day-translator.ts +3 -2
  5. package/common/excel/excel-reader.ts +2 -9
  6. package/common/extensions/array-extensions.ts +116 -0
  7. package/common/extensions/string-extensions.ts +92 -0
  8. package/common/extensions/temporal-extensions.ts +115 -0
  9. package/common/scroll-utils.ts +2 -1
  10. package/common/temporal-helpers.ts +551 -0
  11. package/common/timezone-helper.ts +39 -29
  12. package/common/utils/cookie.ts +11 -8
  13. package/common/utils/date-localization-utils.ts +25 -19
  14. package/common/utils/date-utils.ts +37 -47
  15. package/common/utils/form-utils.ts +3 -1
  16. package/common/utils/language-utils.ts +21 -27
  17. package/common/utils/temporal-utils.ts +43 -0
  18. package/common/utils/upload-image-helper.ts +1 -1
  19. package/common/utils/utils.ts +14 -14
  20. package/common/validation.ts +17 -5
  21. package/components/chart-js/line-chart-flot.tsx +9 -9
  22. package/components/chart-js/thirdparty/flot/jquery.flot.categories.min.js +93 -93
  23. package/components/chart-js/thirdparty/flot/jquery.flot.crosshair.min.js +83 -83
  24. package/components/chart-js/thirdparty/flot/jquery.flot.navigate.min.js +270 -270
  25. package/components/chart-js/thirdparty/flot/jquery.flot.pie.min.js +507 -507
  26. package/components/chart-js/thirdparty/flot/jquery.flot.resize.js +7 -9
  27. package/components/chart-js/thirdparty/flot/jquery.flot.resize.min.js +9 -11
  28. package/components/chart-js/thirdparty/flot/jquery.flot.stack.min.js +104 -104
  29. package/components/chart-js/ts/line-chart-contracts.ts +2 -2
  30. package/components/container-with-breakpoints/ts/breakpoint-handler.ts +2 -2
  31. package/components/counter/testall.tsx +89 -75
  32. package/components/datatable/datatable.tsx +2379 -2375
  33. package/components/datatable/export-excel-modal.tsx +12 -14
  34. package/components/datatable/ts/reorder.ts +4 -2
  35. package/components/dropdown/index.tsx +48 -22
  36. package/components/dropdown/mobile/legacy_fdd.ts +10 -11
  37. package/components/dropzone/gallery-dropzone.tsx +394 -382
  38. package/components/fullcalendar/fullcalendar-draggable-event.tsx +8 -7
  39. package/components/fullcalendar/timegrid-calendar.tsx +60 -67
  40. package/components/image-crop/image-cropping-modal.tsx +9 -8
  41. package/components/image-crop/upload-and-crop.tsx +162 -162
  42. package/components/image-crop/vendor/jquery.Jcrop.min.css +344 -344
  43. package/components/import/import-mapper.tsx +2 -2
  44. package/components/input/daterange-picker.tsx +502 -521
  45. package/components/input/datetime-picker.tsx +45 -50
  46. package/components/input/plugins/daterangepicker/daterangepicker.min.css +400 -400
  47. package/components/input/plugins/daterangepicker/jquery.daterangepicker.min.js +346 -339
  48. package/components/input/plugins/daterangepicker/jquery.daterangepicker.ts +580 -402
  49. package/components/input/radio-button-group.tsx +2 -2
  50. package/components/input/ts/dateInputHelper.ts +1 -0
  51. package/components/input/wysiwig.tsx +12 -7
  52. package/components/svg/skilift-svg.tsx +6 -6
  53. package/package.json +2 -1
  54. package/common/date-wrapper.ts +0 -422
  55. package/common/utils/array-extend.ts +0 -215
  56. package/common/utils/array-remove.ts +0 -10
  57. package/common/utils/array-sort.ts +0 -56
  58. package/common/utils/capitalize-string.ts +0 -11
  59. package/common/utils/format-string.ts +0 -14
  60. package/common/utils/latinize-string.ts +0 -7
@@ -1,3 +1,17 @@
1
+ import {
2
+ createDate,
3
+ dateNow,
4
+ getDate,
5
+ getDay,
6
+ getFullYear,
7
+ getMonth,
8
+ getTime,
9
+ setDate,
10
+ setFullYear,
11
+ setMonth,
12
+ setTime,
13
+ } from '../../../../common/temporal-helpers';
14
+
1
15
  /**
2
16
  * jquery-date-range-picker
3
17
  * @version v0.20.0
@@ -942,327 +956,320 @@
942
956
  s = !1,
943
957
  n = this,
944
958
  i = Z(n).get(0);
945
- return (
946
- Z(this)
947
- .off(".datepicker")
948
- .on("click.datepicker", function (e) {
949
- m.is(":visible") || t(p.duration);
950
- })
951
- .on("change.datepicker", function (e) {
959
+ return (Z(this)
960
+ .off(".datepicker")
961
+ .on("click.datepicker", function (e) {
962
+ m.is(":visible") || t(p.duration);
963
+ })
964
+ .on("change.datepicker", function (e) {
965
+ a();
966
+ })
967
+ .on("keyup.datepicker", function () {
968
+ try {
969
+ clearTimeout(e);
970
+ } catch (e) {}
971
+ e = setTimeout(function () {
952
972
  a();
953
- })
954
- .on("keyup.datepicker", function () {
955
- try {
956
- clearTimeout(e);
957
- } catch (e) {}
958
- e = setTimeout(function () {
959
- a();
960
- }, 2e3);
961
- }),
962
- function () {
963
- var t = this;
964
- if (Z(this).data("date-picker-opened")) return void N();
965
- Z(this).data("date-picker-opened", !0),
966
- (m = (function () {
967
- var e,
968
- t = '<div class="date-picker-wrapper';
969
- p.extraClass && (t += " " + p.extraClass + " "),
970
- p.singleDate && (t += " single-date "),
971
- p.showShortcuts || (t += " no-shortcuts "),
972
- p.showTopbar || (t += " no-topbar "),
973
- p.customTopBar && (t += " custom-topbar "),
974
- (t += '">'),
975
- p.showTopbar &&
976
- ((t += '<div class="drp_top-bar">'),
977
- p.customTopBar
978
- ? ("function" == typeof p.customTopBar && (p.customTopBar = p.customTopBar()), (t += '<div class="custom-top">' + p.customTopBar + "</div>"))
979
- : ((t += '<div class="normal-top"><span class="selection-top">' + K("selected") + ' </span> <b class="start-day">...</b>'),
980
- p.singleDate ||
981
- (t +=
982
- ' <span class="separator-day">' +
983
- p.separator +
984
- '</span> <b class="end-day">...</b> <i class="selected-days">(<span class="selected-days-num">3</span> ' +
985
- K("days") +
986
- ")</i>"),
987
- (t += "</div>"),
988
- (t += '<div class="error-top">error</div><div class="default-top">default</div>')),
989
- (t +=
990
- '<input type="button" class="apply-btn disabled' +
991
- (!(e = "") === p.autoClose && (e += " hide"), "" !== p.applyBtnClass && (e += " " + p.applyBtnClass), e) +
992
- '" value="' +
993
- K("apply") +
994
- '" />'),
995
- (t += "</div>"));
996
- var a = p.showWeekNumbers ? 6 : 5,
997
- n = "&lt;";
998
- p.customArrowPrevSymbol && (n = p.customArrowPrevSymbol);
999
- var r = "&gt;";
1000
- if (
1001
- (p.customArrowNextSymbol && (r = p.customArrowNextSymbol),
973
+ }, 2e3);
974
+ }), function () {
975
+ var t = this;
976
+ if (Z(this).data("date-picker-opened")) return void N();
977
+ Z(this).data("date-picker-opened", !0),
978
+ (m = (function () {
979
+ var e,
980
+ t = '<div class="date-picker-wrapper';
981
+ p.extraClass && (t += " " + p.extraClass + " "),
982
+ p.singleDate && (t += " single-date "),
983
+ p.showShortcuts || (t += " no-shortcuts "),
984
+ p.showTopbar || (t += " no-topbar "),
985
+ p.customTopBar && (t += " custom-topbar "),
986
+ (t += '">'),
987
+ p.showTopbar &&
988
+ ((t += '<div class="drp_top-bar">'),
989
+ p.customTopBar
990
+ ? ("function" == typeof p.customTopBar && (p.customTopBar = p.customTopBar()), (t += '<div class="custom-top">' + p.customTopBar + "</div>"))
991
+ : ((t += '<div class="normal-top"><span class="selection-top">' + K("selected") + ' </span> <b class="start-day">...</b>'),
992
+ p.singleDate ||
993
+ (t +=
994
+ ' <span class="separator-day">' +
995
+ p.separator +
996
+ '</span> <b class="end-day">...</b> <i class="selected-days">(<span class="selected-days-num">3</span> ' +
997
+ K("days") +
998
+ ")</i>"),
999
+ (t += "</div>"),
1000
+ (t += '<div class="error-top">error</div><div class="default-top">default</div>')),
1001
+ (t +=
1002
+ '<input type="button" class="apply-btn disabled' +
1003
+ (!(e = "") === p.autoClose && (e += " hide"), "" !== p.applyBtnClass && (e += " " + p.applyBtnClass), e) +
1004
+ '" value="' +
1005
+ K("apply") +
1006
+ '" />'),
1007
+ (t += "</div>"));
1008
+ var a = p.showWeekNumbers ? 6 : 5,
1009
+ n = "&lt;";
1010
+ p.customArrowPrevSymbol && (n = p.customArrowPrevSymbol);
1011
+ var r = "&gt;";
1012
+ if (
1013
+ (p.customArrowNextSymbol && (r = p.customArrowNextSymbol),
1014
+ (t +=
1015
+ '<div class="month-wrapper"> <table class="month1" cellspacing="0" border="0" cellpadding="0"> <thead> <tr class="caption"> <th> <span class="prev">' +
1016
+ n +
1017
+ ' </span> </th> <th colspan="' +
1018
+ a +
1019
+ '" class="month-name"> </th> <th>' +
1020
+ (p.singleDate || !p.stickyMonths ? '<span class="next">' + r + "</span>" : "") +
1021
+ ' </th> </tr> <tr class="week-name">' +
1022
+ E() +
1023
+ " </thead> <tbody></tbody> </table>"),
1024
+ p.singleMonth ||
1002
1025
  (t +=
1003
- '<div class="month-wrapper"> <table class="month1" cellspacing="0" border="0" cellpadding="0"> <thead> <tr class="caption"> <th> <span class="prev">' +
1004
- n +
1005
- ' </span> </th> <th colspan="' +
1026
+ '<div class="gap">' +
1027
+ (function () {
1028
+ for (var e = ['<div class="gap-top-mask"></div><div class="gap-bottom-mask"></div><div class="gap-lines">'], t = 0; t < 20; t++)
1029
+ e.push('<div class="gap-line"><div class="gap-1"></div><div class="gap-2"></div><div class="gap-3"></div></div>');
1030
+ return e.push("</div>"), e.join("");
1031
+ })() +
1032
+ '</div><table class="month2" cellspacing="0" border="0" cellpadding="0"> <thead> <tr class="caption"> <th>' +
1033
+ (p.stickyMonths ? "" : '<span class="prev">' + n + "</span>") +
1034
+ ' </th> <th colspan="' +
1006
1035
  a +
1007
- '" class="month-name"> </th> <th>' +
1008
- (p.singleDate || !p.stickyMonths ? '<span class="next">' + r + "</span>" : "") +
1009
- ' </th> </tr> <tr class="week-name">' +
1036
+ '" class="month-name"> </th> <th> <span class="next">' +
1037
+ r +
1038
+ '</span> </th> </tr> <tr class="week-name">' +
1010
1039
  E() +
1011
- " </thead> <tbody></tbody> </table>"),
1012
- p.singleMonth ||
1013
- (t +=
1014
- '<div class="gap">' +
1015
- (function () {
1016
- for (var e = ['<div class="gap-top-mask"></div><div class="gap-bottom-mask"></div><div class="gap-lines">'], t = 0; t < 20; t++)
1017
- e.push('<div class="gap-line"><div class="gap-1"></div><div class="gap-2"></div><div class="gap-3"></div></div>');
1018
- return e.push("</div>"), e.join("");
1019
- })() +
1020
- '</div><table class="month2" cellspacing="0" border="0" cellpadding="0"> <thead> <tr class="caption"> <th>' +
1021
- (p.stickyMonths ? "" : '<span class="prev">' + n + "</span>") +
1022
- ' </th> <th colspan="' +
1023
- a +
1024
- '" class="month-name"> </th> <th> <span class="next">' +
1025
- r +
1026
- '</span> </th> </tr> <tr class="week-name">' +
1027
- E() +
1028
- " </thead> <tbody></tbody></table>"),
1029
- (t += '<div class="dp-clearfix"></div><div class="time"><div class="time1"></div>'),
1030
- p.singleDate || (t += '<div class="time2"></div>'),
1031
- (t += '</div><div class="dp-clearfix"></div></div>'),
1032
- (t += '<div class="footer">'),
1033
- p.showShortcuts)
1034
- ) {
1035
- t += '<div class="shortcuts"><b>' + K("shortcuts") + "</b>";
1036
- var s = p.shortcuts;
1037
- if (s) {
1038
- var i;
1039
- if (s["prev-days"] && 0 < s["prev-days"].length) {
1040
- t += '&nbsp;<span class="prev-days">' + K("past");
1041
- for (var o = 0; o < s["prev-days"].length; o++)
1042
- (i = s["prev-days"][o]),
1043
- (i += 1 < s["prev-days"][o] ? K("days") : K("day")),
1044
- (t += ' <a href="javascript:;" shortcut="day,-' + s["prev-days"][o] + '">' + i + "</a>");
1045
- t += "</span>";
1046
- }
1047
- if (s["next-days"] && 0 < s["next-days"].length) {
1048
- t += '&nbsp;<span class="next-days">' + K("following");
1049
- for (var o = 0; o < s["next-days"].length; o++)
1050
- (i = s["next-days"][o]),
1051
- (i += 1 < s["next-days"][o] ? K("days") : K("day")),
1052
- (t += ' <a href="javascript:;" shortcut="day,' + s["next-days"][o] + '">' + i + "</a>");
1053
- t += "</span>";
1054
- }
1055
- if (s.prev && 0 < s.prev.length) {
1056
- t += '&nbsp;<span class="prev-buttons">' + K("previous");
1057
- for (var o = 0; o < s.prev.length; o++) (i = K("prev-" + s.prev[o])), (t += ' <a href="javascript:;" shortcut="prev,' + s.prev[o] + '">' + i + "</a>");
1058
- t += "</span>";
1059
- }
1060
- if (s.next && 0 < s.next.length) {
1061
- t += '&nbsp;<span class="next-buttons">' + K("next");
1062
- for (var o = 0; o < s.next.length; o++) (i = K("next-" + s.next[o])), (t += ' <a href="javascript:;" shortcut="next,' + s.next[o] + '">' + i + "</a>");
1063
- t += "</span>";
1064
- }
1040
+ " </thead> <tbody></tbody></table>"),
1041
+ (t += '<div class="dp-clearfix"></div><div class="time"><div class="time1"></div>'),
1042
+ p.singleDate || (t += '<div class="time2"></div>'),
1043
+ (t += '</div><div class="dp-clearfix"></div></div>'),
1044
+ (t += '<div class="footer">'),
1045
+ p.showShortcuts)
1046
+ ) {
1047
+ t += '<div class="shortcuts"><b>' + K("shortcuts") + "</b>";
1048
+ var s = p.shortcuts;
1049
+ if (s) {
1050
+ var i;
1051
+ if (s["prev-days"] && 0 < s["prev-days"].length) {
1052
+ t += '&nbsp;<span class="prev-days">' + K("past");
1053
+ for (var o = 0; o < s["prev-days"].length; o++)
1054
+ (i = s["prev-days"][o]),
1055
+ (i += 1 < s["prev-days"][o] ? K("days") : K("day")),
1056
+ (t += ' <a href="javascript:;" shortcut="day,-' + s["prev-days"][o] + '">' + i + "</a>");
1057
+ t += "</span>";
1058
+ }
1059
+ if (s["next-days"] && 0 < s["next-days"].length) {
1060
+ t += '&nbsp;<span class="next-days">' + K("following");
1061
+ for (var o = 0; o < s["next-days"].length; o++)
1062
+ (i = s["next-days"][o]),
1063
+ (i += 1 < s["next-days"][o] ? K("days") : K("day")),
1064
+ (t += ' <a href="javascript:;" shortcut="day,' + s["next-days"][o] + '">' + i + "</a>");
1065
+ t += "</span>";
1066
+ }
1067
+ if (s.prev && 0 < s.prev.length) {
1068
+ t += '&nbsp;<span class="prev-buttons">' + K("previous");
1069
+ for (var o = 0; o < s.prev.length; o++) (i = K("prev-" + s.prev[o])), (t += ' <a href="javascript:;" shortcut="prev,' + s.prev[o] + '">' + i + "</a>");
1070
+ t += "</span>";
1071
+ }
1072
+ if (s.next && 0 < s.next.length) {
1073
+ t += '&nbsp;<span class="next-buttons">' + K("next");
1074
+ for (var o = 0; o < s.next.length; o++) (i = K("next-" + s.next[o])), (t += ' <a href="javascript:;" shortcut="next,' + s.next[o] + '">' + i + "</a>");
1075
+ t += "</span>";
1065
1076
  }
1066
- if (p.customShortcuts)
1067
- for (var o = 0; o < p.customShortcuts.length; o++) {
1068
- var d = p.customShortcuts[o];
1069
- t += '&nbsp;<span class="custom-shortcut"><a href="javascript:;" shortcut="custom">' + d.name + "</a></span>";
1070
- }
1071
- t += "</div>";
1072
1077
  }
1073
- if (p.showCustomValues && ((t += '<div class="customValues"><b>' + (p.customValueLabel || K("custom-values")) + "</b>"), p.customValues))
1074
- for (var o = 0; o < p.customValues.length; o++) {
1075
- var l = p.customValues[o];
1076
- t += '&nbsp;<span class="custom-value"><a href="javascript:;" custom="' + l.value + '">' + l.name + "</a></span>";
1078
+ if (p.customShortcuts)
1079
+ for (var o = 0; o < p.customShortcuts.length; o++) {
1080
+ var d = p.customShortcuts[o];
1081
+ t += '&nbsp;<span class="custom-shortcut"><a href="javascript:;" shortcut="custom">' + d.name + "</a></span>";
1077
1082
  }
1078
- return Z((t += "</div></div>"));
1079
- })().hide()).append('<div class="date-range-length-tip"></div>'),
1080
- Z(p.container).append(m),
1081
- p.inline ? m.addClass("inline-wrapper") : o();
1082
- p.alwaysOpen && m.find(".apply-btn").hide();
1083
- var e = _();
1084
- if ((G(e), p.time.enabled))
1085
- if ((p.startDate && p.endDate) || (p.start && p.end)) Y(Q(p.start || p.startDate).toDate(), "time1"), Y(Q(p.end || p.endDate).toDate(), "time2");
1086
- else {
1087
- var a = p.defaultEndTime ? p.defaultEndTime : e;
1088
- Y(e, "time1"), Y(a, "time2");
1083
+ t += "</div>";
1089
1084
  }
1090
- var n = "";
1091
- n = p.singleDate ? K("default-single") : p.minDays && p.maxDays ? K("default-range") : p.minDays ? K("default-more") : p.maxDays ? K("default-less") : K("default-default");
1092
- m.find(".default-top").html(n.replace(/\%d/, p.minDays).replace(/\%d/, p.maxDays)), p.singleMonth ? m.addClass("single-month") : m.addClass("two-months");
1093
- setTimeout(function () {
1094
- l(), (s = !0);
1095
- }, 0),
1096
- m.click(function (e) {
1097
- e.stopPropagation();
1098
- }),
1099
- Z(document).on("click.datepicker", U),
1100
- m.find(".next").click(function () {
1101
- p.stickyMonths
1102
- ? (function (e) {
1103
- var t = H(p.month1),
1104
- a = H(p.month2);
1105
- if (q(a)) return;
1106
- if (!p.singleDate && 0 <= L(t, a)) return;
1107
- z(t, "month1"), z(a, "month2"), j();
1108
- })()
1109
- : (function (e) {
1110
- var t = Z(e).parents("table").hasClass("month2"),
1111
- a = t ? p.month2 : p.month1;
1112
- if (((a = H(a)), (!p.singleMonth && !p.singleDate && !t && 0 <= L(a, p.month2)) || q(a))) return;
1113
- z(a, t ? "month2" : "month1"), I();
1114
- })(this);
1115
- }),
1116
- m.find(".prev").click(function () {
1117
- p.stickyMonths
1118
- ? (function (e) {
1119
- var t = R(p.month1),
1120
- a = R(p.month2);
1121
- if (q(t)) return;
1122
- if (!p.singleDate && L(a, t) <= 0) return;
1123
- z(a, "month2"), z(t, "month1"), j();
1124
- })()
1125
- : (function (e) {
1126
- var t = Z(e).parents("table").hasClass("month2"),
1127
- a = t ? p.month2 : p.month1;
1128
- if (((a = R(a)), (t && L(a, p.month1) <= 0) || q(a))) return;
1129
- z(a, t ? "month2" : "month1"), I();
1130
- })(this);
1131
- }),
1132
- m
1133
- .attr("unselectable", "on")
1134
- .css("user-select", "none")
1135
- .on("selectstart", function (e) {
1136
- return e.preventDefault(), !1;
1137
- }),
1138
- m.find(".apply-btn").click(function () {
1139
- N();
1140
- var e = W(new Date(p.start)) + p.separator + W(new Date(p.end));
1141
- Z(t).trigger("datepicker-apply", { value: e, date1: new Date(p.start), date2: new Date(p.end) });
1142
- }),
1143
- m.find("[custom]").click(function () {
1144
- var e = Z(this).attr("custom");
1145
- (p.start = !1), (p.end = !1), m.find(".day.checked").removeClass("checked"), p.setValue.call(i, e), M(), S(!0), j(), p.autoClose && N();
1085
+ if (p.showCustomValues && ((t += '<div class="customValues"><b>' + (p.customValueLabel || K("custom-values")) + "</b>"), p.customValues))
1086
+ for (var o = 0; o < p.customValues.length; o++) {
1087
+ var l = p.customValues[o];
1088
+ t += '&nbsp;<span class="custom-value"><a href="javascript:;" custom="' + l.value + '">' + l.name + "</a></span>";
1089
+ }
1090
+ return Z((t += "</div></div>"));
1091
+ })().hide()).append('<div class="date-range-length-tip"></div>'),
1092
+ Z(p.container).append(m),
1093
+ p.inline ? m.addClass("inline-wrapper") : o();
1094
+ p.alwaysOpen && m.find(".apply-btn").hide();
1095
+ var e = _();
1096
+ if ((G(e), p.time.enabled))
1097
+ if ((p.startDate && p.endDate) || (p.start && p.end)) Y(Q(p.start || p.startDate).toDate(), "time1"), Y(Q(p.end || p.endDate).toDate(), "time2");
1098
+ else {
1099
+ var a = p.defaultEndTime ? p.defaultEndTime : e;
1100
+ Y(e, "time1"), Y(a, "time2");
1101
+ }
1102
+ var n = "";
1103
+ n = p.singleDate ? K("default-single") : p.minDays && p.maxDays ? K("default-range") : p.minDays ? K("default-more") : p.maxDays ? K("default-less") : K("default-default");
1104
+ m.find(".default-top").html(n.replace(/\%d/, p.minDays).replace(/\%d/, p.maxDays)), p.singleMonth ? m.addClass("single-month") : m.addClass("two-months");
1105
+ setTimeout(function () {
1106
+ l(), (s = !0);
1107
+ }, 0),
1108
+ m.click(function (e) {
1109
+ e.stopPropagation();
1110
+ }),
1111
+ Z(document).on("click.datepicker", U),
1112
+ m.find(".next").click(function () {
1113
+ p.stickyMonths
1114
+ ? (function (e) {
1115
+ var t = H(p.month1),
1116
+ a = H(p.month2);
1117
+ if (q(a)) return;
1118
+ if (!p.singleDate && 0 <= L(t, a)) return;
1119
+ z(t, "month1"), z(a, "month2"), j();
1120
+ })()
1121
+ : (function (e) {
1122
+ var t = Z(e).parents("table").hasClass("month2"),
1123
+ a = t ? p.month2 : p.month1;
1124
+ if (((a = H(a)), (!p.singleMonth && !p.singleDate && !t && 0 <= L(a, p.month2)) || q(a))) return;
1125
+ z(a, t ? "month2" : "month1"), I();
1126
+ })(this);
1127
+ }),
1128
+ m.find(".prev").click(function () {
1129
+ p.stickyMonths
1130
+ ? (function (e) {
1131
+ var t = R(p.month1),
1132
+ a = R(p.month2);
1133
+ if (q(t)) return;
1134
+ if (!p.singleDate && L(a, t) <= 0) return;
1135
+ z(a, "month2"), z(t, "month1"), j();
1136
+ })()
1137
+ : (function (e) {
1138
+ var t = Z(e).parents("table").hasClass("month2"),
1139
+ a = t ? p.month2 : p.month1;
1140
+ if (((a = R(a)), (t && L(a, p.month1) <= 0) || q(a))) return;
1141
+ z(a, t ? "month2" : "month1"), I();
1142
+ })(this);
1143
+ }),
1144
+ m
1145
+ .attr("unselectable", "on")
1146
+ .css("user-select", "none")
1147
+ .on("selectstart", function (e) {
1148
+ return e.preventDefault(), !1;
1146
1149
  }),
1147
- m.find("[shortcut]").click(function () {
1148
- var e,
1149
- t = Z(this).attr("shortcut"),
1150
- a = new Date(),
1151
- n = !1;
1152
- if (-1 != t.indexOf("day")) {
1153
- var r = parseInt(t.split(",", 2)[1], 10);
1154
- (n = new Date(new Date().getTime() + 864e5 * r)), (a = new Date(a.getTime() + 864e5 * (0 < r ? 1 : -1)));
1155
- } else if (-1 != t.indexOf("week")) {
1156
- var s;
1157
- for (
1158
- e = -1 != t.indexOf("prev,") ? -1 : 1, s = 1 == e ? ("monday" == p.startOfWeek ? 1 : 0) : "monday" == p.startOfWeek ? 0 : 6, a = new Date(a.getTime() - 864e5);
1159
- a.getDay() != s;
1150
+ m.find(".apply-btn").click(function () {
1151
+ N();
1152
+ var e = W(createDate(p.start)) + p.separator + W(createDate(p.end));
1153
+ Z(t).trigger("datepicker-apply", { value: e, date1: createDate(p.start), date2: createDate(p.end) });
1154
+ }),
1155
+ m.find("[custom]").click(function () {
1156
+ var e = Z(this).attr("custom");
1157
+ (p.start = !1), (p.end = !1), m.find(".day.checked").removeClass("checked"), p.setValue.call(i, e), M(), S(!0), j(), p.autoClose && N();
1158
+ }),
1159
+ m.find("[shortcut]").click(function () {
1160
+ var e,
1161
+ t = Z(this).attr("shortcut"),
1162
+ a = dateNow(),
1163
+ n = !1;
1164
+ if (-1 != t.indexOf("day")) {
1165
+ var r = parseInt(t.split(",", 2)[1], 10);
1166
+ (n = createDate(getTime(dateNow()) + 864e5 * r)), (a = createDate(getTime(a) + 864e5 * (0 < r ? 1 : -1)));
1167
+ } else if (-1 != t.indexOf("week")) {
1168
+ var s;
1169
+ for (
1170
+ e = -1 != t.indexOf("prev,") ? -1 : 1, s = 1 == e ? ("monday" == p.startOfWeek ? 1 : 0) : "monday" == p.startOfWeek ? 0 : 6, a = createDate(getTime(a) - 864e5);
1171
+ getDay(a) != s;
1160
1172
 
1161
- )
1162
- a = new Date(a.getTime() + 864e5 * e);
1163
- n = new Date(a.getTime() + 864e5 * e * 6);
1164
- } else if (-1 != t.indexOf("month"))
1165
- (e = -1 != t.indexOf("prev,") ? -1 : 1), (n = 1 == e ? H(a) : R(a)).setDate(1), (a = H(n)).setDate(1), (a = new Date(a.getTime() - 864e5));
1166
- else if (-1 != t.indexOf("year"))
1167
- (e = -1 != t.indexOf("prev,") ? -1 : 1),
1168
- (n = new Date()).setFullYear(a.getFullYear() + e),
1169
- n.setMonth(0),
1170
- n.setDate(1),
1171
- a.setFullYear(a.getFullYear() + e),
1172
- a.setMonth(11),
1173
- a.setDate(31);
1174
- else if ("custom" == t) {
1175
- var i = Z(this).html();
1176
- if (p.customShortcuts && 0 < p.customShortcuts.length)
1177
- for (var o = 0; o < p.customShortcuts.length; o++) {
1178
- var d = p.customShortcuts[o];
1179
- if (d.name == i) {
1180
- var l = [];
1181
- if (((l = d.dates.call()) && 2 == l.length && ((n = l[0]), (a = l[1])), l && 1 == l.length)) {
1182
- var u = l[0];
1183
- z(u, "month1"), z(H(u), "month2"), I();
1184
- }
1185
- break;
1173
+ )
1174
+ a = createDate(getTime(a) + 864e5 * e);
1175
+ n = createDate(getTime(a) + 864e5 * e * 6);
1176
+ } else if (-1 != t.indexOf("month"))
1177
+ (e = -1 != t.indexOf("prev,") ? -1 : 1), setDate((n = 1 == e ? H(a) : R(a)), 1), setDate((a = H(n)), 1), (a = createDate(getTime(a) - 864e5));
1178
+ else if (-1 != t.indexOf("year"))
1179
+ (e = -1 != t.indexOf("prev,") ? -1 : 1),
1180
+ setFullYear((n = dateNow()), getFullYear(a) + e),
1181
+ setMonth(n, 0),
1182
+ setDate(n, 1),
1183
+ setFullYear(a, getFullYear(a) + e),
1184
+ setMonth(a, 11),
1185
+ setDate(a, 31);
1186
+ else if ("custom" == t) {
1187
+ var i = Z(this).html();
1188
+ if (p.customShortcuts && 0 < p.customShortcuts.length)
1189
+ for (var o = 0; o < p.customShortcuts.length; o++) {
1190
+ var d = p.customShortcuts[o];
1191
+ if (d.name == i) {
1192
+ var l = [];
1193
+ if (((l = d.dates.call()) && 2 == l.length && ((n = l[0]), (a = l[1])), l && 1 == l.length)) {
1194
+ var u = l[0];
1195
+ z(u, "month1"), z(H(u), "month2"), I();
1186
1196
  }
1197
+ break;
1187
1198
  }
1188
- }
1189
- n && a && (T(n, a), M());
1190
- }),
1191
- m.find(".time1 input[type=range]").on("change touchmove", function (e) {
1192
- var t = e.target,
1193
- a =
1194
- "hour" == t.name
1195
- ? Z(t)
1196
- .val()
1197
- .replace(/^(\d{1})$/, "0$1")
1198
- : void 0,
1199
- n =
1200
- "minute" == t.name
1201
- ? Z(t)
1202
- .val()
1203
- .replace(/^(\d{1})$/, "0$1")
1204
- : void 0;
1205
- c("time1", a, n);
1206
- }),
1207
- m.find(".time2 input[type=range]").on("change touchmove", function (e) {
1208
- var t = e.target,
1209
- a =
1210
- "hour" == t.name
1211
- ? Z(t)
1212
- .val()
1213
- .replace(/^(\d{1})$/, "0$1")
1214
- : void 0,
1215
- n =
1216
- "minute" == t.name
1217
- ? Z(t)
1218
- .val()
1219
- .replace(/^(\d{1})$/, "0$1")
1220
- : void 0;
1221
- c("time2", a, n);
1222
- });
1223
- }.call(this),
1224
- p.alwaysOpen && t(0),
1225
- Z(this).data("dateRangePicker", {
1226
- setStart: function (e) {
1227
- return "string" == typeof e && (e = Q(e, p.format).toDate()), (p.end = !1), C(e), this;
1228
- },
1229
- setEnd: function (e, t) {
1230
- var a = new Date();
1231
- return a.setTime(p.start), "string" == typeof e && (e = Q(e, p.format).toDate()), T(a, e, t), this;
1232
- },
1233
- setDateRange: function (e, t, a) {
1234
- "string" == typeof e && "string" == typeof t && ((e = Q(e, p.format).toDate()), (t = Q(t, p.format).toDate())), T(e, t, a);
1235
- },
1236
- clear: function () {
1237
- (p.start = !1),
1238
- (p.end = !1),
1239
- m.find(".day.checked").removeClass("checked"),
1240
- m.find(".day.last-date-selected").removeClass("last-date-selected"),
1241
- m.find(".day.first-date-selected").removeClass("first-date-selected"),
1242
- p.setValue.call(i, ""),
1243
- M(),
1244
- S(),
1245
- j();
1246
- },
1247
- close: N,
1248
- open: t,
1249
- redraw: B,
1250
- getDatePicker: function () {
1251
- return m;
1252
- },
1253
- resetMonthsView: G,
1254
- destroy: function () {
1255
- Z(n).off(".datepicker"),
1256
- Z(n).data("dateRangePicker", ""),
1257
- Z(n).data("date-picker-opened", null),
1258
- m.remove(),
1259
- Z(window).off("resize.datepicker", o),
1260
- Z(document).off("click.datepicker", U);
1261
- },
1262
- }),
1263
- Z(window).on("resize.datepicker", o),
1264
- this
1265
- );
1199
+ }
1200
+ }
1201
+ n && a && (T(n, a), M());
1202
+ }),
1203
+ m.find(".time1 input[type=range]").on("change touchmove", function (e) {
1204
+ var t = e.target,
1205
+ a =
1206
+ "hour" == t.name
1207
+ ? Z(t)
1208
+ .val()
1209
+ .replace(/^(\d{1})$/, "0$1")
1210
+ : void 0,
1211
+ n =
1212
+ "minute" == t.name
1213
+ ? Z(t)
1214
+ .val()
1215
+ .replace(/^(\d{1})$/, "0$1")
1216
+ : void 0;
1217
+ c("time1", a, n);
1218
+ }),
1219
+ m.find(".time2 input[type=range]").on("change touchmove", function (e) {
1220
+ var t = e.target,
1221
+ a =
1222
+ "hour" == t.name
1223
+ ? Z(t)
1224
+ .val()
1225
+ .replace(/^(\d{1})$/, "0$1")
1226
+ : void 0,
1227
+ n =
1228
+ "minute" == t.name
1229
+ ? Z(t)
1230
+ .val()
1231
+ .replace(/^(\d{1})$/, "0$1")
1232
+ : void 0;
1233
+ c("time2", a, n);
1234
+ });
1235
+ }.call(this), p.alwaysOpen && t(0), Z(this).data("dateRangePicker", {
1236
+ setStart: function (e) {
1237
+ return "string" == typeof e && (e = Q(e, p.format).toDate()), (p.end = !1), C(e), this;
1238
+ },
1239
+ setEnd: function (e, t) {
1240
+ var a = dateNow();
1241
+ return setTime(a, p.start), "string" == typeof e && (e = Q(e, p.format).toDate()), T(a, e, t), this;
1242
+ },
1243
+ setDateRange: function (e, t, a) {
1244
+ "string" == typeof e && "string" == typeof t && ((e = Q(e, p.format).toDate()), (t = Q(t, p.format).toDate())), T(e, t, a);
1245
+ },
1246
+ clear: function () {
1247
+ (p.start = !1),
1248
+ (p.end = !1),
1249
+ m.find(".day.checked").removeClass("checked"),
1250
+ m.find(".day.last-date-selected").removeClass("last-date-selected"),
1251
+ m.find(".day.first-date-selected").removeClass("first-date-selected"),
1252
+ p.setValue.call(i, ""),
1253
+ M(),
1254
+ S(),
1255
+ j();
1256
+ },
1257
+ close: N,
1258
+ open: t,
1259
+ redraw: B,
1260
+ getDatePicker: function () {
1261
+ return m;
1262
+ },
1263
+ resetMonthsView: G,
1264
+ destroy: function () {
1265
+ Z(n).off(".datepicker"),
1266
+ Z(n).data("dateRangePicker", ""),
1267
+ Z(n).data("date-picker-opened", null),
1268
+ m.remove(),
1269
+ Z(window).off("resize.datepicker", o),
1270
+ Z(document).off("click.datepicker", U);
1271
+ },
1272
+ }), Z(window).on("resize.datepicker", o), this);
1266
1273
  function o() {
1267
1274
  if (!p.inline) {
1268
1275
  var e = Z(n).offset();
@@ -1399,7 +1406,7 @@
1399
1406
  (p.start = parseInt(p.start)),
1400
1407
  (p.end = parseInt(p.end)),
1401
1408
  b(),
1402
- p.start && !p.end && (Z(n).trigger("datepicker-first-date-selected", { date1: new Date(p.start) }), y(e)),
1409
+ p.start && !p.end && (Z(n).trigger("datepicker-first-date-selected", { date1: createDate(p.start) }), y(e)),
1403
1410
  w(),
1404
1411
  M(),
1405
1412
  S(),
@@ -1417,7 +1424,7 @@
1417
1424
  if (p.selectBackward && e > p.start) return !1;
1418
1425
  if (p.beforeShowDay && "function" == typeof p.beforeShowDay) {
1419
1426
  for (var t = !0, a = e; 1 < O(a, p.start); ) {
1420
- if (!p.beforeShowDay(new Date(a))[0]) {
1427
+ if (!p.beforeShowDay(createDate(a))[0]) {
1421
1428
  t = !1;
1422
1429
  break;
1423
1430
  }
@@ -1525,19 +1532,19 @@
1525
1532
  m.find(".start-day").html("..."),
1526
1533
  m.find(".end-day").html("..."),
1527
1534
  m.find(".selected-days").hide(),
1528
- p.start && m.find(".start-day").html(W(new Date(parseInt(p.start)))),
1529
- p.end && m.find(".end-day").html(W(new Date(parseInt(p.end)))),
1535
+ p.start && m.find(".start-day").html(W(createDate(parseInt(p.start)))),
1536
+ p.end && m.find(".end-day").html(W(createDate(parseInt(p.end)))),
1530
1537
  p.start && p.singleDate
1531
1538
  ? (m.find(".apply-btn").removeClass("disabled"),
1532
- (a = W(new Date(p.start))),
1533
- p.setValue.call(i, a, W(new Date(p.start)), W(new Date(p.end))),
1534
- s && !t && Z(n).trigger("datepicker-change", { value: a, date1: new Date(p.start) }))
1539
+ (a = W(createDate(p.start))),
1540
+ p.setValue.call(i, a, W(createDate(p.start)), W(createDate(p.end))),
1541
+ s && !t && Z(n).trigger("datepicker-change", { value: a, date1: createDate(p.start) }))
1535
1542
  : p.start && p.end
1536
1543
  ? (m.find(".selected-days").show().find(".selected-days-num").html(O(p.end, p.start)),
1537
1544
  m.find(".apply-btn").removeClass("disabled"),
1538
- (a = W(new Date(p.start)) + p.separator + W(new Date(p.end))),
1539
- p.setValue.call(i, a, W(new Date(p.start)), W(new Date(p.end))),
1540
- s && !t && Z(n).trigger("datepicker-change", { value: a, date1: new Date(p.start), date2: new Date(p.end) }))
1545
+ (a = W(createDate(p.start)) + p.separator + W(createDate(p.end))),
1546
+ p.setValue.call(i, a, W(createDate(p.start)), W(createDate(p.end))),
1547
+ s && !t && Z(n).trigger("datepicker-change", { value: a, date1: createDate(p.start), date2: createDate(p.end) }))
1541
1548
  : e
1542
1549
  ? m.find(".apply-btn").removeClass("disabled")
1543
1550
  : m.find(".apply-btn").addClass("disabled");
@@ -1546,14 +1553,14 @@
1546
1553
  return Math.abs(Q(e).diff(Q(t), "d")) + 1;
1547
1554
  }
1548
1555
  function T(e, t, a) {
1549
- if (e.getTime() > t.getTime()) {
1556
+ if (getTime(e) > getTime(t)) {
1550
1557
  var n = t;
1551
1558
  (t = e), (e = n), (n = null);
1552
1559
  }
1553
1560
  var r = !0;
1554
1561
  if ((p.startDate && F(e, p.startDate) < 0 && (r = !1), p.endDate && 0 < F(t, p.endDate) && (r = !1), !r)) return z(p.startDate, "month1"), z(H(p.startDate), "month2"), void I();
1555
- (p.start = e.getTime()),
1556
- (p.end = t.getTime()),
1562
+ (p.start = getTime(e)),
1563
+ (p.end = getTime(t)),
1557
1564
  p.time.enabled && (u("time1", e), u("time2", t)),
1558
1565
  (p.stickyMonths || (0 < F(e, t) && 0 === L(e, t))) && (p.lookBehind ? (e = R(t)) : (t = H(e))),
1559
1566
  p.stickyMonths && !1 !== p.endDate && 0 < L(t, p.endDate) && ((e = R(e)), (t = R(t))),
@@ -1568,7 +1575,7 @@
1568
1575
  function C(e) {
1569
1576
  var t = !0;
1570
1577
  if ((p.startDate && F(e, p.startDate) < 0 && (t = !1), p.endDate && 0 < F(e, p.endDate) && (t = !1), t)) {
1571
- if (((p.start = e.getTime()), p.time.enabled && u("time1", e), z(e, "month1"), !0 !== p.singleMonth)) z(H(e), "month2");
1578
+ if (((p.start = getTime(e)), p.time.enabled && u("time1", e), z(e, "month1"), !0 !== p.singleMonth)) z(H(e), "month2");
1572
1579
  I(), S(), x();
1573
1580
  } else z(p.startDate, "month1");
1574
1581
  }
@@ -1634,31 +1641,31 @@
1634
1641
  m.find("." + t + " tbody").html(
1635
1642
  (function (e) {
1636
1643
  var t = [];
1637
- e.setDate(1);
1638
- new Date(e.getTime() - 864e5);
1644
+ setDate(e, 1);
1645
+ createDate(getTime(e) - 864e5);
1639
1646
  var a,
1640
1647
  n,
1641
- r = new Date(),
1642
- s = e.getDay();
1648
+ r = dateNow(),
1649
+ s = getDay(e);
1643
1650
  0 === s && "monday" === p.startOfWeek && (s = 7);
1644
1651
  if (0 < s)
1645
1652
  for (var i = s; 0 < i; i--) {
1646
- var o = new Date(e.getTime() - 864e5 * i);
1647
- (n = k(o.getTime())),
1653
+ var o = createDate(getTime(e) - 864e5 * i);
1654
+ (n = k(getTime(o))),
1648
1655
  p.startDate && F(o, p.startDate) < 0 && (n = !1),
1649
1656
  p.endDate && 0 < F(o, p.endDate) && (n = !1),
1650
- t.push({ date: o, type: "lastMonth", day: o.getDate(), time: o.getTime(), valid: n });
1657
+ t.push({ date: o, type: "lastMonth", day: getDate(o), time: getTime(o), valid: n });
1651
1658
  }
1652
- for (var d = e.getMonth(), i = 0; i < 40; i++)
1659
+ for (var d = getMonth(e), i = 0; i < 40; i++)
1653
1660
  (a = Q(e).add(i, "days").toDate()),
1654
- (n = k(a.getTime())),
1661
+ (n = k(getTime(a))),
1655
1662
  p.startDate && F(a, p.startDate) < 0 && (n = !1),
1656
1663
  p.endDate && 0 < F(a, p.endDate) && (n = !1),
1657
1664
  t.push({
1658
1665
  date: a,
1659
- type: a.getMonth() == d ? "toMonth" : "nextMonth",
1660
- day: a.getDate(),
1661
- time: a.getTime(),
1666
+ type: getMonth(a) == d ? "toMonth" : "nextMonth",
1667
+ day: getDate(a),
1668
+ time: getTime(a),
1662
1669
  valid: n,
1663
1670
  });
1664
1671
  for (var l = [], u = 0; u < 6 && "nextMonth" != t[7 * u].type; u++) {
@@ -1713,8 +1720,8 @@
1713
1720
  (r = parseInt(t.attr("data-start-time"), 10)),
1714
1721
  p.startWeek
1715
1722
  ? (m.find(".week-number-selected").removeClass("week-number-selected"),
1716
- (a = new Date(r < p.startWeek ? r : p.startWeek)),
1717
- (n = new Date(r < p.startWeek ? p.startWeek : r)),
1723
+ (a = createDate(r < p.startWeek ? r : p.startWeek)),
1724
+ (n = createDate(r < p.startWeek ? p.startWeek : r)),
1718
1725
  (p.startWeek = !1),
1719
1726
  (p.start = Q(a)
1720
1727
  .day("monday" == p.startOfWeek ? 1 : 0)
@@ -1724,7 +1731,7 @@
1724
1731
  .valueOf()))
1725
1732
  : ((p.startWeek = r),
1726
1733
  t.addClass("week-number-selected"),
1727
- (a = new Date(r)),
1734
+ (a = createDate(r)),
1728
1735
  (p.start = Q(a)
1729
1736
  .day("monday" == p.startOfWeek ? 1 : 0)
1730
1737
  .valueOf()),
@@ -1883,7 +1890,7 @@
1883
1890
  return null == a && (a = e in n ? n[e] : t in n ? n[t] : ""), a;
1884
1891
  }
1885
1892
  function _() {
1886
- var e = p.defaultTime ? p.defaultTime : new Date();
1893
+ var e = p.defaultTime ? p.defaultTime : dateNow();
1887
1894
  return (
1888
1895
  p.lookBehind
1889
1896
  ? (p.startDate && L(e, p.startDate) < 0 && (e = H(Q(p.startDate).toDate())), p.endDate && 0 < L(e, p.endDate) && (e = Q(p.endDate).toDate()))