@cashub/ui 0.18.4 → 0.18.6
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.
|
@@ -46,7 +46,9 @@ var Month = function Month(_ref) {
|
|
|
46
46
|
setAccordionCurrentDisplayType = _useContext.setAccordionCurrentDisplayType;
|
|
47
47
|
|
|
48
48
|
var handleChangeMonth = (0, _react.useCallback)(function (month) {
|
|
49
|
+
// switch to the first day of the target month
|
|
49
50
|
var date = new Date(selectedDate);
|
|
51
|
+
date.setDate(1);
|
|
50
52
|
date.setMonth(month);
|
|
51
53
|
setSelectedDate((0, _utils.datetimeTFormat)(date));
|
|
52
54
|
setAccordionCurrentDisplayType(null);
|
|
@@ -112,11 +114,13 @@ var Month = function Month(_ref) {
|
|
|
112
114
|
return !(minDate1st <= date);
|
|
113
115
|
} else if (maxDate && !minDate) {
|
|
114
116
|
maxDate1st.setDate(1);
|
|
117
|
+
maxDate1st.setHours(23, 59, 59, 0);
|
|
115
118
|
return !(maxDate1st >= date);
|
|
116
119
|
} else if (minDate && maxDate) {
|
|
120
|
+
minDate1st.setDate(1);
|
|
117
121
|
minDate1st.setHours(0, 0, 0, 0);
|
|
118
122
|
maxDate1st.setDate(1);
|
|
119
|
-
|
|
123
|
+
maxDate1st.setHours(23, 59, 59, 0);
|
|
120
124
|
return !(minDate1st <= date && maxDate1st >= date);
|
|
121
125
|
}
|
|
122
126
|
}, [fixedYear, maxDate, minDate, selectedDate]);
|