File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
src/VueDatePicker/components Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change 173
173
* Check if value is within min-max range
174
174
*/
175
175
const checkMinMaxValue = (value : number | string ): boolean => {
176
- if (props .maxValue === null && props .minValue === null ) return false ;
176
+ const hasMax = props .maxValue || props .maxValue === 0 ;
177
+ const hasMin = props .minValue || props .minValue === 0 ;
178
+ if (! hasMax && ! hasMin ) return false ;
177
179
178
- const isAboveMax = props .maxValue || + props .maxValue === 0 ? + value > + props .maxValue : false ;
179
- const isBellowMin = props .minValue || + props .minValue === 0 ? + value < + props .minValue : false ;
180
+ if (hasMax && hasMin ) {
181
+ return + value > + props .maxValue || + value < + props .minValue ;
182
+ }
183
+ if (hasMax ) {
184
+ return + value > + props .maxValue ;
185
+ }
186
+
187
+ if (hasMin ) {
188
+ return + value < + props .minValue ;
189
+ }
180
190
181
- return isAboveMax || isBellowMin ;
191
+ return false ;
182
192
};
183
193
184
194
/**
You can’t perform that action at this time.
0 commit comments