@lumx/react 3.13.2-alpha.0 → 3.13.3-alpha.0
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/index.js
CHANGED
|
@@ -6055,8 +6055,14 @@ const getMonthCalendar = function (locale) {
|
|
|
6055
6055
|
let rangeMinDate = arguments.length > 2 ? arguments[2] : undefined;
|
|
6056
6056
|
let rangeMaxDate = arguments.length > 3 ? arguments[3] : undefined;
|
|
6057
6057
|
const month = referenceDate.getMonth();
|
|
6058
|
-
const iterDate = new Date(referenceDate
|
|
6058
|
+
const iterDate = new Date(referenceDate);
|
|
6059
6059
|
iterDate.setDate(1);
|
|
6060
|
+
const minDate = rangeMinDate && new Date(rangeMinDate);
|
|
6061
|
+
const maxDate = rangeMaxDate && new Date(rangeMaxDate);
|
|
6062
|
+
// Reset time to compare dates only.
|
|
6063
|
+
iterDate.setUTCHours(0, 0, 0, 0);
|
|
6064
|
+
minDate === null || minDate === void 0 ? void 0 : minDate.setUTCHours(0, 0, 0, 0);
|
|
6065
|
+
maxDate === null || maxDate === void 0 ? void 0 : maxDate.setUTCHours(0, 0, 0, 0);
|
|
6060
6066
|
const weekDays = getWeekDays(locale);
|
|
6061
6067
|
const lastDayOfWeek = last(weekDays);
|
|
6062
6068
|
const weeks = [];
|
|
@@ -6069,7 +6075,8 @@ const getMonthCalendar = function (locale) {
|
|
|
6069
6075
|
};
|
|
6070
6076
|
|
|
6071
6077
|
// If a range is specified, check if the day is out of range.
|
|
6072
|
-
|
|
6078
|
+
// min and max date are included within the valid range.
|
|
6079
|
+
if (minDate && iterDate < minDate || maxDate && iterDate > maxDate) {
|
|
6073
6080
|
day.isOutOfRange = true;
|
|
6074
6081
|
}
|
|
6075
6082
|
if (iterDate.getMonth() === month) {
|