amos-apptool 1.2.0 → 1.2.1
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/esm/math/calendarUtils.js +22 -9
- package/index.d.ts +720 -300
- package/lib/math/calendarUtils.js +18 -5
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: !0
|
|
7
7
|
}), exports.CalendarUtils = void 0;
|
|
8
8
|
|
|
9
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray")), DateHelper = {
|
|
9
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")), _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray")), DateHelper = {
|
|
10
10
|
isLeapYear: function(e) {
|
|
11
11
|
return e % 4 == 0 && e % 100 != 0 || e % 400 == 0;
|
|
12
12
|
},
|
|
@@ -51,8 +51,8 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
|
51
51
|
var D = 864e5, c = o - u * D, i = o + (6 - u) * D;
|
|
52
52
|
return [ DateHelper.date2Str(new Date(c)), DateHelper.date2Str(new Date(i)) ];
|
|
53
53
|
}
|
|
54
|
-
var
|
|
55
|
-
return [ DateHelper.date2Str(new Date(
|
|
54
|
+
var y = 864e5, l = o - ((u = 0 === u ? 7 : u) - 1) * y, g = o + (7 - u) * y;
|
|
55
|
+
return [ DateHelper.date2Str(new Date(l)), DateHelper.date2Str(new Date(g)) ];
|
|
56
56
|
},
|
|
57
57
|
formatResultDate: function(e) {
|
|
58
58
|
var t = (0, _toConsumableArray2.default)(e.split("-"));
|
|
@@ -128,7 +128,19 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
|
128
128
|
}, getCurrentWeekDays = function(e, t) {
|
|
129
129
|
var r = new Date(e.year, e.month - 1, e.date), a = (r.getDay() + 7 - t) % 7;
|
|
130
130
|
return [ convertDateToDay(new Date(r.getTime() - 864e5 * a)), convertDateToDay(new Date(r.getTime() + 864e5 * (6 - a))) ];
|
|
131
|
-
}
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
function checkIsToday(e) {
|
|
134
|
+
if ("object" !== (0, _typeof2.default)(e)) return !1;
|
|
135
|
+
var t = e || {}, r = t.type, a = t.year, n = t.month, o = t.date;
|
|
136
|
+
if ("current" === r) {
|
|
137
|
+
var u = new Date, D = convertDateToDay(u);
|
|
138
|
+
return a === D.year && n === D.month && o === D.date;
|
|
139
|
+
}
|
|
140
|
+
return !1;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
var CalendarUtils = exports.CalendarUtils = {
|
|
132
144
|
DateHelper: DateHelper,
|
|
133
145
|
getCurrMonthData: getCurrMonthData,
|
|
134
146
|
getDaysStatus: getDaysStatus,
|
|
@@ -137,5 +149,6 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
|
137
149
|
convertDayToDate: convertDayToDate,
|
|
138
150
|
getPrevMonthDays: getPrevMonthDays,
|
|
139
151
|
getCurrentMonthDays: getCurrentMonthDays,
|
|
140
|
-
getCurrentWeekDays: getCurrentWeekDays
|
|
152
|
+
getCurrentWeekDays: getCurrentWeekDays,
|
|
153
|
+
checkIsToday: checkIsToday
|
|
141
154
|
};
|