@momo-kits/date-picker 0.92.7 → 0.92.8

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 (2) hide show
  1. package/index.tsx +9 -8
  2. package/package.json +1 -1
package/index.tsx CHANGED
@@ -102,16 +102,17 @@ const DateTimePicker: FC<DateTimePickerProps> = ({
102
102
  }
103
103
  }
104
104
 
105
- onChange?.(
106
- new Date(
107
- newDate.year,
108
- newDate.month - 1,
109
- newDate.day,
110
- newDate.hour,
111
- newDate.min,
112
- ),
105
+ const changedDate = new Date(
106
+ newDate.year,
107
+ newDate.month - 1,
108
+ newDate.day,
109
+ newDate.hour,
110
+ newDate.min,
113
111
  );
114
112
 
113
+ if (changedDate <= maxDate && changedDate >= minDate) {
114
+ onChange?.(changedDate);
115
+ }
115
116
  setCurrentDate(newDate);
116
117
  };
117
118
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/date-picker",
3
- "version": "0.92.7",
3
+ "version": "0.92.8",
4
4
  "private": false,
5
5
  "main": "index.tsx",
6
6
  "peerDependencies": {