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.
- package/app/powerduck-initializer.ts +3 -3
- package/common/api-http.ts +20 -14
- package/common/css/ladda-themeless-zoomin.min.css +89 -89
- package/common/enum-translation/day-translator.ts +3 -2
- package/common/excel/excel-reader.ts +2 -9
- package/common/extensions/array-extensions.ts +116 -0
- package/common/extensions/string-extensions.ts +92 -0
- package/common/extensions/temporal-extensions.ts +115 -0
- package/common/scroll-utils.ts +2 -1
- package/common/temporal-helpers.ts +551 -0
- package/common/timezone-helper.ts +39 -29
- package/common/utils/cookie.ts +11 -8
- package/common/utils/date-localization-utils.ts +25 -19
- package/common/utils/date-utils.ts +37 -47
- package/common/utils/form-utils.ts +3 -1
- package/common/utils/language-utils.ts +21 -27
- package/common/utils/temporal-utils.ts +43 -0
- package/common/utils/upload-image-helper.ts +1 -1
- package/common/utils/utils.ts +14 -14
- package/common/validation.ts +17 -5
- package/components/chart-js/line-chart-flot.tsx +9 -9
- package/components/chart-js/thirdparty/flot/jquery.flot.categories.min.js +93 -93
- package/components/chart-js/thirdparty/flot/jquery.flot.crosshair.min.js +83 -83
- package/components/chart-js/thirdparty/flot/jquery.flot.navigate.min.js +270 -270
- package/components/chart-js/thirdparty/flot/jquery.flot.pie.min.js +507 -507
- package/components/chart-js/thirdparty/flot/jquery.flot.resize.js +7 -9
- package/components/chart-js/thirdparty/flot/jquery.flot.resize.min.js +9 -11
- package/components/chart-js/thirdparty/flot/jquery.flot.stack.min.js +104 -104
- package/components/chart-js/ts/line-chart-contracts.ts +2 -2
- package/components/container-with-breakpoints/ts/breakpoint-handler.ts +2 -2
- package/components/counter/testall.tsx +89 -75
- package/components/datatable/datatable.tsx +2379 -2375
- package/components/datatable/export-excel-modal.tsx +12 -14
- package/components/datatable/ts/reorder.ts +4 -2
- package/components/dropdown/index.tsx +48 -22
- package/components/dropdown/mobile/legacy_fdd.ts +10 -11
- package/components/dropzone/gallery-dropzone.tsx +394 -382
- package/components/fullcalendar/fullcalendar-draggable-event.tsx +8 -7
- package/components/fullcalendar/timegrid-calendar.tsx +60 -67
- package/components/image-crop/image-cropping-modal.tsx +9 -8
- package/components/image-crop/upload-and-crop.tsx +162 -162
- package/components/image-crop/vendor/jquery.Jcrop.min.css +344 -344
- package/components/import/import-mapper.tsx +2 -2
- package/components/input/daterange-picker.tsx +502 -521
- package/components/input/datetime-picker.tsx +45 -50
- package/components/input/plugins/daterangepicker/daterangepicker.min.css +400 -400
- package/components/input/plugins/daterangepicker/jquery.daterangepicker.min.js +346 -339
- package/components/input/plugins/daterangepicker/jquery.daterangepicker.ts +580 -402
- package/components/input/radio-button-group.tsx +2 -2
- package/components/input/ts/dateInputHelper.ts +1 -0
- package/components/input/wysiwig.tsx +12 -7
- package/components/svg/skilift-svg.tsx +6 -6
- package/package.json +2 -1
- package/common/date-wrapper.ts +0 -422
- package/common/utils/array-extend.ts +0 -215
- package/common/utils/array-remove.ts +0 -10
- package/common/utils/array-sort.ts +0 -56
- package/common/utils/capitalize-string.ts +0 -11
- package/common/utils/format-string.ts +0 -14
- 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
|
-
|
|
947
|
-
|
|
948
|
-
.
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
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
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
t
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
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 = "<";
|
|
1010
|
+
p.customArrowPrevSymbol && (n = p.customArrowPrevSymbol);
|
|
1011
|
+
var r = ">";
|
|
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="
|
|
1004
|
-
|
|
1005
|
-
|
|
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">
|
|
1008
|
-
|
|
1009
|
-
'
|
|
1036
|
+
'" class="month-name"> </th> <th> <span class="next">' +
|
|
1037
|
+
r +
|
|
1038
|
+
'</span> </th> </tr> <tr class="week-name">' +
|
|
1010
1039
|
E() +
|
|
1011
|
-
"
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
if (s["next-days"] && 0 < s["next-days"].length) {
|
|
1048
|
-
t += ' <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 += ' <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 += ' <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 += ' <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 += ' <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 += ' <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 += ' <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 += ' <span class="custom-shortcut"><a href="javascript:;" shortcut="custom">' + d.name + "</a></span>";
|
|
1070
|
-
}
|
|
1071
|
-
t += "</div>";
|
|
1072
1077
|
}
|
|
1073
|
-
if (p.
|
|
1074
|
-
for (var o = 0; o < p.
|
|
1075
|
-
var
|
|
1076
|
-
t += ' <span class="custom-
|
|
1078
|
+
if (p.customShortcuts)
|
|
1079
|
+
for (var o = 0; o < p.customShortcuts.length; o++) {
|
|
1080
|
+
var d = p.customShortcuts[o];
|
|
1081
|
+
t += ' <span class="custom-shortcut"><a href="javascript:;" shortcut="custom">' + d.name + "</a></span>";
|
|
1077
1082
|
}
|
|
1078
|
-
|
|
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
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
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 += ' <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
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
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
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
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
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
(p.
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
Z(n).
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
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:
|
|
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(
|
|
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(
|
|
1529
|
-
p.end && m.find(".end-day").html(W(
|
|
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(
|
|
1533
|
-
p.setValue.call(i, a, W(
|
|
1534
|
-
s && !t && Z(n).trigger("datepicker-change", { value: a, date1:
|
|
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(
|
|
1539
|
-
p.setValue.call(i, a, W(
|
|
1540
|
-
s && !t && Z(n).trigger("datepicker-change", { value: a, date1:
|
|
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 (
|
|
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 =
|
|
1556
|
-
(p.end =
|
|
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 =
|
|
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
|
-
|
|
1638
|
-
|
|
1644
|
+
setDate(e, 1);
|
|
1645
|
+
createDate(getTime(e) - 864e5);
|
|
1639
1646
|
var a,
|
|
1640
1647
|
n,
|
|
1641
|
-
r =
|
|
1642
|
-
s =
|
|
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 =
|
|
1647
|
-
(n = k(
|
|
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:
|
|
1657
|
+
t.push({ date: o, type: "lastMonth", day: getDate(o), time: getTime(o), valid: n });
|
|
1651
1658
|
}
|
|
1652
|
-
for (var d =
|
|
1659
|
+
for (var d = getMonth(e), i = 0; i < 40; i++)
|
|
1653
1660
|
(a = Q(e).add(i, "days").toDate()),
|
|
1654
|
-
(n = k(
|
|
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:
|
|
1660
|
-
day:
|
|
1661
|
-
time:
|
|
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 =
|
|
1717
|
-
(n =
|
|
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 =
|
|
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 :
|
|
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()))
|